vue3-viewer icon indicating copy to clipboard operation
vue3-viewer copied to clipboard

直接从vue3开始的,感觉这个插件的用法好像还是vue2的写法。

Open leosin opened this issue 3 years ago • 1 comments

非常棒的一个插件,效果非常惊艳

由于我还是初学,感觉这个插件的用法好像还是vue2的写法。 比如其中里面还用到了this什么的。作者能否抽时间给个标准的vue3的写法呢,以及在setup script下的。 万分感谢。

leosin avatar Jun 18 '22 04:06 leosin

例子里的this是为了兼容vue2的原始写法,setup的上下文你可以看做是普通的js脚本块。原本要用$变量名存储到this上才能在上下文中调用的变量,在setup中直接声明为普通变量就行了。 可以参考在线Demo中的源码,this.$el、this.$viewer的vue3写法都有出现。 https://github.com/mirari/vue3-viewer/blob/master/example/views/example/ApiExample.vue https://github.com/mirari/vue3-viewer/blob/master/example/views/example/DirectiveExample.vue

mirari avatar Jun 18 '22 15:06 mirari