Vue quote myself to write js

In doing bomb box section, to use a drag effect plug-ins to search for a long time, but the feeling is not very consistent that I need, so put before the write js drag took over, put in vue . What happens when a specific operation that it? Let's look together at:
1. First create a new drag.js in assets / js Lane
2. drag js copy to the inside, and export default out.

Drag default function Export (ID) {
// Code content
}
. 1
2
. 3
3. In this introduction to the main.js js, and tied on the prototype vue:

import { drag } from ‘./assets/js/drag.js’

Vue.prototype. d r a g = d r a g 1234. again go with page surface Make use of Time Wait t h i s . drag = drag 1 2 3 4. use when the page again, just call this. Drag () on it.

Author: learning_H
Source: CSDN
Original: https://blog.csdn.net/qq_42345237/article/details/89603714
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin blog.csdn.net/qq_39738016/article/details/91493987