Browse Source

引入插件

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

2
.gitignore

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

23
main.js

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

43
node_modules/.package-lock.json

@ -1,15 +1,32 @@
{
"name": "plant_manage_mobile",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
}
"name": "plant_manage_mobile",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"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": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
}
}

83
package-lock.json

@ -1,27 +1,60 @@
{
"name": "plant_manage_mobile",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"uview-ui": "^2.0.35"
}
},
"node_modules/uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"dependencies": {
"uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g=="
}
}
"name": "plant_manage_mobile",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"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": {
"callsites": "^3.1.0"
}
},
"node_modules/uview-ui": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"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": {
"version": "2.0.35",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.35.tgz",
"integrity": "sha512-OfMttN3XkHvQosXfd8bjz8ASTvypPoGzBWmQZBJ871bYMCA7t2bDFPlzjbxUj/5ykAjKnZ8zMUapSwSisVt99g=="
}
}
}

10
package.json

@ -1,5 +1,9 @@
{
"dependencies": {
"uview-ui": "^2.0.35"
}
"name":"plant_manage_mobile",
"version":"1.0.0",
"main":"main.js",
"dependencies": {
"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
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"easycom":{
"^u-(.*)":"uview-ui/components/u-$1/u-$1.vue"
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",

56
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>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
<u-icon name="photo" color="#2979ff" size="28"></u-icon>
<u-button type="primary">主要按钮</u-button>
</view>
</template>
@ -15,38 +41,10 @@
}
},
onLoad() {
},
methods: {
}
}
</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-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
@import 'uview-ui/theme.scss'
Loading…
Cancel
Save