Browse Source

引入插件

master
邓宏 2 years ago
parent
commit
f2db1a2c0f
  1. 2
      .gitignore
  2. 21
      main.js
  3. 17
      node_modules/.package-lock.json
  4. 35
      package-lock.json
  5. 6
      package.json
  6. 18
      pages.js
  7. 11
      pages.json
  8. 54
      pages/index/index.vue
  9. 10
      store/index.js
  10. 2
      uni.scss

2
.gitignore

@ -0,0 +1,2 @@
node_modules
/unpackage/dist/

21
main.js

@ -1,21 +1,14 @@
import Vue from 'vue'
import App from './App' import App from './App'
import store from './store'
import uView from 'uview-ui';
// #ifndef VUE3 Vue.use(uView)
import Vue from 'vue' Vue.prototype.$store=store
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
...App ...App,
store,
}) })
app.$mount() app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif

17
node_modules/.package-lock.json

@ -1,8 +1,25 @@
{ {
"name": "plant_manage_mobile", "name": "plant_manage_mobile",
"version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/uni-pages-hot-modules": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/uni-pages-hot-modules/-/uni-pages-hot-modules-0.1.3.tgz",
"integrity": "sha512-2nZ6XeHkLtdNLCSDl+/N9+SiXvcLbULyRBHBMyvs5sK9AUfexVlpJZT6InqKYv1DuCZm/+g7HL43f/qvTWqB9Q==",
"dependencies": {
"callsites": "^3.1.0"
}
},
"node_modules/uview-ui": { "node_modules/uview-ui": {
"version": "2.0.35", "version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz", "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",

35
package-lock.json

@ -1,11 +1,31 @@
{ {
"name": "plant_manage_mobile", "name": "plant_manage_mobile",
"version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "plant_manage_mobile",
"version": "1.0.0",
"dependencies": {
"uni-pages-hot-modules": "^0.1.1",
"uview-ui": "^2.0.33"
}
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/uni-pages-hot-modules": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/uni-pages-hot-modules/-/uni-pages-hot-modules-0.1.3.tgz",
"integrity": "sha512-2nZ6XeHkLtdNLCSDl+/N9+SiXvcLbULyRBHBMyvs5sK9AUfexVlpJZT6InqKYv1DuCZm/+g7HL43f/qvTWqB9Q==",
"dependencies": { "dependencies": {
"uview-ui": "^2.0.35" "callsites": "^3.1.0"
} }
}, },
"node_modules/uview-ui": { "node_modules/uview-ui": {
@ -18,6 +38,19 @@
} }
}, },
"dependencies": { "dependencies": {
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"uni-pages-hot-modules": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/uni-pages-hot-modules/-/uni-pages-hot-modules-0.1.3.tgz",
"integrity": "sha512-2nZ6XeHkLtdNLCSDl+/N9+SiXvcLbULyRBHBMyvs5sK9AUfexVlpJZT6InqKYv1DuCZm/+g7HL43f/qvTWqB9Q==",
"requires": {
"callsites": "^3.1.0"
}
},
"uview-ui": { "uview-ui": {
"version": "2.0.35", "version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz", "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",

6
package.json

@ -1,5 +1,9 @@
{ {
"name":"plant_manage_mobile",
"version":"1.0.0",
"main":"main.js",
"dependencies": { "dependencies": {
"uview-ui": "^2.0.35" "uni-pages-hot-modules": "^0.1.1",
"uview-ui": "^2.0.33"
} }
} }

18
pages.js

@ -0,0 +1,18 @@
const {hot} = require('uni-pages-hot-modules')
module.exports = hot((pagesJson)=>{
return{
...pagesJson,
pages:[
{
"path":"pages/index/index",
"style":{
"navigationBarTitleText":"种植管理",
"app-plus":{
"titleNView":true
}
}
}
]
}
})

11
pages.json

@ -1,12 +1,7 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "easycom":{
{ "^u-(.*)":"uview-ui/components/u-$1/u-$1.vue"
"path": "pages/index/index", },
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",

54
pages/index/index.vue

@ -1,9 +1,35 @@
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&>.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
&>.text-area {
display: flex;
justify-content: center;
&>.title {
font-size: 36rpx;
color: red;
}
}
}
</style>
<template> <template>
<view class="content"> <view class="content">
<image class="logo" src="/static/logo.png"></image> <image class="logo" src="/static/logo.png"></image>
<view class="text-area"> <view class="text-area">
<text class="title">{{title}}</text> <text class="title">{{title}}</text>
</view> </view>
<u-icon name="photo" color="#2979ff" size="28"></u-icon>
<u-button type="primary">主要按钮</u-button>
</view> </view>
</template> </template>
@ -22,31 +48,3 @@
} }
} }
</script> </script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

10
store/index.js

@ -0,0 +1,10 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state:{},
getters:{},
mutations:{},
actions:{}
})

2
uni.scss

@ -74,3 +74,5 @@ $uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px; $uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px; $uni-font-size-paragraph:15px;
@import 'uview-ui/theme.scss'
Loading…
Cancel
Save