1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import Vue from 'vue'
- import App from '@/App'
- import $store from '@/store'
- import config from "./config.js"
- Vue.prototype.$config = config
- import uView from "uview-ui";
- Vue.use(uView);
- //全局引入iconpark图标
- // import { install } from '@icon-park/vue/es/all';
- // install(Vue, '');
- // Vue.use(VueRouter)
- //配置跳转小程序
- // Vue.config.ignoredElements = ['wx-open-launch-weapp'];
- //配置防止连点的公共方法
- import common from './common/util/clicks.js'
- Vue.prototype.$noMultipleClicks = common.noMultipleClicks;
- // 防连点方法
- Vue.directive('throttle', {
- inserted(el, binding) {
- el.addEventListener('click', () => {
- el.style.pointerEvents = 'none'
- if (!el.disabled) {
- setTimeout(() => {
- el.style.pointerEvents = 'auto'
- }, binding.value || 2000)
- }
- })
- }
- })
- Vue.prototype.$store = $store // vuex
- Vue.prototype.$offset = function(selector) { // 获取元素宽高位置信息
- return new Promise((resolve, reject) => {
- uni.createSelectorQuery().in(this).select(selector).boundingClientRect(data => {
- console.log(data,'data')
- data ? data.x = data.left + data.width / 2 : ''
- data ? data.y = data.top + data.height / 2 : ''
- data ? resolve(data) : reject('元素不存在')
- }).exec()
- })
- }
- import CustomNav from './components/public/custom-nav.vue' //自定义头部导航栏交互组件
- Vue.component('custom-nav', CustomNav) //注册自定义头部导航栏
- import * as filters from '@/filters'
- Object.keys(filters).forEach(e => {
- Vue.filter(e, filters[e])
- })
- App.mpType = 'app'
- Vue.config.productionTip = false;
- (new Vue({
- ...App
- })).$mount()
|