4

能用 vue 写个独立的 js 文件供第三方用么?

 2 years ago
source link: https://www.v2ex.com/t/839147
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Vue.js

能用 vue 写个独立的 js 文件供第三方用么?

  snoopyhai · 1 小时 31 分钟前 · 451 次点击

今儿拿到个需求,写个 js 库,供第三方使用。

习惯 vue 了,突然就把我整不会了。。

大致是这样,写个 js 库,里面封装好一个小界面和交互。比如一个华丽的 mp3 播放器。 用户直接引入 js ,然后实例化配置,就会在指定的 dom 中插入这个播放器,并使用。

但是已经习惯了 vue 了,是否能用 vue 写这么个东西。最后脱离 vue 成为一个单文件库。

脑子空白一片,没思路。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK