vue获取到dom节点
Vue-stickto (vue-stickto)
A vue directive that support multiple DOM Node stick to top automatically.
支持多个DOM节点的vue指令会自动粘贴到顶部。
安装 (Install)
npm install vue-stickto
用 (use)
import
进口
import Vue from 'vue'
import VueStickto from 'vue-stickto'
Vue.use(VueStickto)
simply add the directive into a tag
只需将指令添加到标签中
<div v-stickto>
</div>
see the result
看到结果
如果您使用脚本标签导入 (If you're using script tag to import)
copy the dist/VueStickto.js
to the place wherever you want and <script src="[path]Vuestickto.js"/>
将dist/VueStickto.js
复制到您想要的位置,然后<script src="[path]Vuestickto.js"/>
翻译自: https://vuejsexamples.com/a-vue-directive-that-support-multiple-dom-node-stick-to-top-automatically/
vue获取到dom节点