vue中怎么用AlloyFinger?

vue里面如何引入触屏的AlloyFinger啊,看了官方的也不会弄,有报错,下面是我的代码:

// main.jsimport Vue from 'vue'import App from './App'
// 下面两种都试了,都报错
// import AlloyFingerVue from 'AlloyFinger'
// Vue.use(AlloyFingerVue)import AlloyFinger from 'AlloyFinger'Vue.use(AlloyFinger)/* eslint-disable no-new */new Vue({
  el: '#app',
  template: '<App/>',
  components: { App }
})

报错信息

https://img1.mukewang.com/5be92c71000139a104310159.jpg

肥皂起泡泡
浏览 1580回答 1
1回答

子衿沉夜

不是给你用法了吗Vue.use(AlloyFingerVue); // use AlloyFinger's pluginvar h = new Vue({&nbsp; &nbsp; el: '#cnt',&nbsp; &nbsp; methods: {&nbsp; &nbsp; &nbsp; &nbsp; tap: function() { console.log('onTap'); },&nbsp; &nbsp; &nbsp; &nbsp; multipointStart: function() { console.log('onMultipointStart'); },&nbsp; &nbsp; &nbsp; &nbsp; longTap: function() { console.log('onLongTap'); },&nbsp; &nbsp; &nbsp; &nbsp; swipe: function(evt) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log("swipe" + evt.direction);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('onSwipe');&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; pinch: function(evt) {&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(evt.scale);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('onPinch');&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; rotate: function(evt) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(evt.angle);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('onRotate');&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; pressMove: function(evt) {&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(evt.deltaX);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(evt.deltaY);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('onPressMove');&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; multipointEnd: function() { console.log('onMultipointEnd'); },&nbsp; &nbsp; &nbsp; &nbsp; doubleTap: function() { console.log('onDoubleTap'); },&nbsp; &nbsp; &nbsp; &nbsp; singleTap: function () { console.log('onSingleTap'); },&nbsp; &nbsp; &nbsp; &nbsp; touchStart: function() { console.log('onTouchStart'); },&nbsp; &nbsp; &nbsp; &nbsp; touchMove: function() { console.log('onTouchMove'); },&nbsp; &nbsp; &nbsp; &nbsp; touchEnd: function() { console.log('onTouchEnd'); },&nbsp; &nbsp; &nbsp; &nbsp; touchCancel: function() { console.log('onTouchCancel'); }&nbsp; &nbsp; }});
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript