# 入口文件配置

  • entry.js:

该文件在项目位置:src/common/js/entry.js

依赖资源的引入,可以在这个文件中配置,示例如下:

// 通用入口配置
// 主入口文件
import Vue from 'vue'
import FastClick from 'fastclick'
import '@/common/styles/dolphin.scss'
import 'amfe-flexible'
import JsBridge from '@dolphin-iot/jsbridge-sdk'
import DolphinCore from '@/plugins/dolphin-core.js'

//按需引入组件库
import { Button, Switch, Cell, Icon, ScrollView, Catalog } from '@dolphin-iot/ui'
import '@dolphin-iot/ui/dist/minixui.css'
Button.install(Vue)
Switch.install(Vue)
Cell.install(Vue)
ScrollView.install(Vue)
Icon.install(Vue)
Catalog.install(Vue)

FastClick.attach(document.body)

if (process.env.VUE_APP_ENV === 'mock') {
    require('@/mock')
}

if (
    process.env.NODE_ENV === 'development' ||
    process.env.VUE_APP_ENV === 'development' ||
    process.env.VUE_APP_ENV === 'mock'
) {
    const vConsole = require('vconsole')
    const pkg = require('../../../package.json')
    console.info(`current version : v${pkg.version}`)
    new vConsole()
}
Vue.config.productionTip = false
Vue.use(JsBridge)
Vue.use(DolphinCore)

export default function appInit(App) {
    new Vue({
        render: (h) => h(App),
    }).$mount('#app')
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

# 新建子项目

  • 支持多个子项目并行开发:

CLI 功能:待开放

更新时间: 12/3/2021, 1:48:16 PM