I am using svg.js
in my Laravel project running vue.js
.
This is how i use svg.js
Step 1: Install svg.js
as a plugin in my vue app.
import svgJs from "svg.js/dist/svg"
export default {
install(Vue) {
Vue.prototype.$svg = svgJs
}
}
Step 2: Import and use the plugin.
import svgJs from "./plugins/vueSvgPlugin"
Vue.use(svgJs);
Step 3: Then i can do this.
console.log(this.$svg);
console.log(this.$svg.get("samplesvg"));
However i am not sure how to add the svg.js
plugins. I want to use below three plugins, in case someone wants to know.
- svg.select.js
- svg.resize.js
- svg.draggable.js