排名
7
文章
192
粉丝
15
评论
16
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

前言
uniapp是基于vue.js实现的,代码实现方法不能用jQuery的思路去解决问题,
基本使用
template: 模板
view: 视图,使用时把view当成HTML里的div就行
- <template>
- <view class="container">
- <view class="title">TNBLOG_APP
- <view class="sub-title">
- 您的生活好帮手
- </view>
- </view>
- </view>
- </template>
页面传参数事件
v-on:click :单击事件
nui.navigateTo:页面跳转
onLoad:页面加载时运行
- <view class="logn-btn">
- //绑定登陆事件 v-on:click="logen" 等价于@click="login"
- <button @click="login">登录</button>
- </view>
-
-
- <script>
- export default {
- data() {
- return {
- username:"",
- pwd:""
- }
- },
- methods: {
- //logen为方法名
- login:function(){
- //页面跳转
- uni.navigateTo({
- //指向的url
- url:'../User/User?username='+userName+'&pwd'+pwd
- })
- });
-
- }
- }
- }
- </script>
-
- //接收页面,在加载事件中获取值
- onLoad(option){
- username = option.username
- pwd = option.pwd
- }
评价