vue获取到dom节点_支持多个DOM节点的Vue指令会自动粘贴到顶部

Vue-stickto是一个Vue指令,支持多个DOM节点自动粘贴到顶部。它可以通过安装和简单地添加到标签中来使用。如果通过脚本标签导入,可以直接复制到所需位置。
摘要由CSDN通过智能技术生成

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)

  1. import

    进口

import Vue from 'vue'
import VueStickto from 'vue-stickto'
Vue.use(VueStickto)
  1. simply add the directive into a tag

    只需将指令添加到标签中

<div v-stickto>
    
</div>
  1. 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节点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值