mirror of
				https://github.com/xxxsf/vue3-h5-template.git
				synced 2025-11-04 10:50:08 +08:00 
			
		
		
		
	add mint-ui
This commit is contained in:
		
							parent
							
								
									e5b0985b45
								
							
						
					
					
						commit
						5ab5755dcf
					
				@ -6,7 +6,6 @@
 | 
				
			|||||||
    "extract-text-webpack-plugin": "^0.8.2",
 | 
					    "extract-text-webpack-plugin": "^0.8.2",
 | 
				
			||||||
    "mint-ui": "^0.2.7",
 | 
					    "mint-ui": "^0.2.7",
 | 
				
			||||||
    "open-browser-webpack-plugin": "^0.0.2",
 | 
					    "open-browser-webpack-plugin": "^0.0.2",
 | 
				
			||||||
    "weui": "^0.4.3"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "babel-core": "^6.3.17",
 | 
					    "babel-core": "^6.3.17",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								src/app.js
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/app.js
									
									
									
									
									
								
							@ -5,29 +5,17 @@ require('./css/animate.css');
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const Vue = require('vue');
 | 
					const Vue = require('vue');
 | 
				
			||||||
const VueRouter = require('vue-router');
 | 
					const VueRouter = require('vue-router');
 | 
				
			||||||
const filters = require('./common/filters');// register filters 自定义过滤器
 | 
					const filters = require('./common/filters');  // register filters 自定义过滤器
 | 
				
			||||||
 | 
					const _config = require('./common/config');   // API接口 可以在需要的页面引入,此页面可以不引入!
 | 
				
			||||||
const _config = require('./common/config');// API接口 可以在需要的页面引入,此页面可以不引入!
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//console.log(_config.SERVICE.EDU.DETAILS);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Object.keys(filters).forEach(function(k) {
 | 
					 | 
				
			||||||
//  Vue.filter(k, filters[k]);
 | 
					 | 
				
			||||||
//});
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
var App = Vue.extend(require('./app.vue'));
 | 
					var App = Vue.extend(require('./app.vue'));
 | 
				
			||||||
    Vue.use(VueRouter);
 | 
					    Vue.use(VueRouter);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
var router = new VueRouter(
 | 
					var router = new VueRouter({
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
	  hashbang: true,  //为true的时候 example.com/#!/foo/bar , false的时候 example.com/#/foo/bar
 | 
						  hashbang: true,  //为true的时候 example.com/#!/foo/bar , false的时候 example.com/#/foo/bar
 | 
				
			||||||
	  //abstract:true,  //地址栏不会有变化
 | 
						  //abstract:true,  //地址栏不会有变化
 | 
				
			||||||
	  //以下设置需要服务端设置
 | 
					 | 
				
			||||||
	  //history: false,   //当使用 HTML5 history 模式时,服务器需要被正确配置 以防用户在直接访问链接时会遇到404页面。
 | 
					 | 
				
			||||||
	  //saveScrollPosition: false
 | 
					 | 
				
			||||||
	  linkActiveClass:'custom-active-class' //全局设置连接匹配时的类名 参考http://vuejs.github.io/vue-router/en/link.html
 | 
						  linkActiveClass:'custom-active-class' //全局设置连接匹配时的类名 参考http://vuejs.github.io/vue-router/en/link.html
 | 
				
			||||||
	}
 | 
					});
 | 
				
			||||||
);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
require('./routers')(router);
 | 
					require('./routers')(router);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								src/app.vue
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/app.vue
									
									
									
									
									
								
							@ -10,7 +10,9 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
module.exports = {
 | 
					    import 'mint-ui/lib/style.css';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    module.exports = {
 | 
				
			||||||
        data: function() {
 | 
					        data: function() {
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                items:{
 | 
					                items:{
 | 
				
			||||||
@ -29,15 +31,10 @@ module.exports = {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    components:{
 | 
					 | 
				
			||||||
//      modal:require('./components/modal.vue'),
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    created:function(){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        methods:{
 | 
					        methods:{
 | 
				
			||||||
 | 
					            /* do someThing */
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
				
			|||||||
@ -49,6 +49,7 @@
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .select_components_mask{
 | 
					    .select_components_mask{
 | 
				
			||||||
      position: fixed;
 | 
					      position: fixed;
 | 
				
			||||||
      left: 0;
 | 
					      left: 0;
 | 
				
			||||||
 | 
				
			|||||||
@ -2,10 +2,6 @@ h2{
 | 
				
			|||||||
	font-size: 28px;
 | 
						font-size: 28px;
 | 
				
			||||||
	text-align: center;
 | 
						text-align: center;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
span{
 | 
					 | 
				
			||||||
	font-size: 15px;
 | 
					 | 
				
			||||||
	color: red;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
p{
 | 
					p{
 | 
				
			||||||
	font-size: 14px;
 | 
						font-size: 14px;
 | 
				
			||||||
	text-align: center;
 | 
						text-align: center;
 | 
				
			||||||
 | 
				
			|||||||
@ -14,9 +14,6 @@
 | 
				
			|||||||
	<div class="index">
 | 
						<div class="index">
 | 
				
			||||||
		<h2>vue-router 介绍:</h2>
 | 
							<h2>vue-router 介绍:</h2>
 | 
				
			||||||
		<a class="router-link" href="http://router.vuejs.org/zh-cn/" target="_blank">点击这里</a>
 | 
							<a class="router-link" href="http://router.vuejs.org/zh-cn/" target="_blank">点击这里</a>
 | 
				
			||||||
 | 
					 | 
				
			||||||
		<mt-cell title="标题文字"></mt-cell>
 | 
					 | 
				
			||||||
		<mt-cell title="标题文字" value="说明文字"></mt-cell>
 | 
					 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -24,8 +21,7 @@
 | 
				
			|||||||
	var lifecycle = []; //为了描述生命周期, 在 canActivate 阶段 还没有 this.lifecycle
 | 
						var lifecycle = []; //为了描述生命周期, 在 canActivate 阶段 还没有 this.lifecycle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	import Vue from 'vue'
 | 
						import Vue from 'vue'
 | 
				
			||||||
	import { Cell } from 'mint-ui';
 | 
						import { Toast } from 'mint-ui';
 | 
				
			||||||
	Vue.component(Cell.name, Cell);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	module.exports = {
 | 
						module.exports = {
 | 
				
			||||||
		//props: ['父组建传的值'],
 | 
							//props: ['父组建传的值'],
 | 
				
			||||||
@ -41,7 +37,7 @@
 | 
				
			|||||||
			//waitForData: true, //数据加载完毕后再切换试图,也就是 点击之后先没反应,然后数据加载完,再出发过渡效果
 | 
								//waitForData: true, //数据加载完毕后再切换试图,也就是 点击之后先没反应,然后数据加载完,再出发过渡效果
 | 
				
			||||||
			canActivate:function(transition){
 | 
								canActivate:function(transition){
 | 
				
			||||||
				//canActivate阶段,可以做一些用户验证的事情
 | 
									//canActivate阶段,可以做一些用户验证的事情
 | 
				
			||||||
				console.log(1);
 | 
					                Toast('Test toast');
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			activate:function(transition){
 | 
								activate:function(transition){
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user