No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how to use fabric.js?

    Framework
    3
    4
    878
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yiyinlin.tw last edited by

      Is anyone can tell how to use fabric.js ?
      I did install fabric,and import fabric already.
      but it only show blank page without error.

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by

        You probably want to make it a plugin. You can some examples here: https://forum.quasar-framework.org/topic/2743/suggestion-feedback-from-a-new-user-s-perspective/6

        1 Reply Last reply Reply Quote 0
        • Y
          yiyinlin.tw last edited by Shone

          I did make it a plugin.

          import fabric from 'fabric'
          export default ({ Vue }) => {
            Vue.prototype.$fabric = fabric
          }
          

          then add a test.vue in components.

          mounted () {
              var canvas = new this.$fabric.fabric.Canvas('canvas')
              var rect = new this.$fabric.fabric.Rect({
                left: 100,
                top: 150,
                fill: 'red',
                width: 200,
                height: 200
              })
              canvas.add(rect)
            }
          

          but nothing happened.

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Have a look here.

            https://github.com/sunyatasattva/vue-fabric

            It might give you some ideas how to implement fabric.

            Scott

            1 Reply Last reply Reply Quote 0
            • First post
              Last post