You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
1.9 KiB
101 lines
1.9 KiB
3 months ago
|
<template>
|
||
|
<view class="wrap">
|
||
|
<u-action-sheet :actions="list" :title="title" :show="show"></u-action-sheet>
|
||
|
<u-button class="count" @click="show = true">打开ActionSheet</u-button>
|
||
|
<text class="u-line-1">是日也,天朗气清,惠风和畅,仰观宇宙之大,俯察品类之盛</text>
|
||
|
<view class="u-border-bottom box">
|
||
|
夫人之相与,俯仰一世,或取诸怀抱,悟言一室之内;或因寄所托,放浪形骸之外
|
||
|
</view>
|
||
|
<view class="box">
|
||
|
121312
|
||
|
</view>
|
||
|
<button>点击登录</button>
|
||
|
|
||
|
<view @click="aa">
|
||
|
dianwo
|
||
|
</view>
|
||
|
<view class="">
|
||
|
{{sys}}
|
||
|
</view>
|
||
|
|
||
|
<view class="">
|
||
|
|
||
|
版本号为:{{vuex_version}}
|
||
|
<<琵琶行>>的作者为{{vuex_user.name}}
|
||
|
</view>
|
||
|
|
||
|
<u-button @click="modifyVuex">修改变量</u-button>
|
||
|
<u-button @click="api">获取接口</u-button>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
title: '标题',
|
||
|
list: [{
|
||
|
name: '选项一',
|
||
|
subname: "选项一描述",
|
||
|
color: '#ffaa7f',
|
||
|
fontSize: '20'
|
||
|
},
|
||
|
{
|
||
|
name: '选项二禁用',
|
||
|
disabled: true
|
||
|
},
|
||
|
{
|
||
|
name: '开启load加载', //开启后文字不显示
|
||
|
loading: true
|
||
|
}
|
||
|
],
|
||
|
show: false,
|
||
|
sys: ''
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
|
||
|
api() {
|
||
|
uni.$u.http.get('/users', {}).then(res => {
|
||
|
console.log(res);
|
||
|
}).catch(err => {
|
||
|
|
||
|
})
|
||
|
//
|
||
|
},
|
||
|
|
||
|
|
||
|
|
||
|
aa() {
|
||
|
console.log(uni.$u.pages());
|
||
|
this.sys = uni.$u.sys().model
|
||
|
// this.sys = uni.$u.pages()
|
||
|
},
|
||
|
|
||
|
modifyVuex() {
|
||
|
this.$u.vuex('vuex_version', '1.0.2');
|
||
|
// 修改对象的形式,中间用"."分隔
|
||
|
this.$u.vuex('vuex_user.name', '诗圣');
|
||
|
// this.$u.vuex('aa', 'zxx');
|
||
|
}
|
||
|
|
||
|
}
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
|
||
|
<!-- 请确保在style标签声明了"lang="scss"" -->
|
||
|
<style lang="scss" scoped>
|
||
|
.wrap {
|
||
|
background-color: $u-bg-color;
|
||
|
min-height: 100vh;
|
||
|
}
|
||
|
|
||
|
.box {
|
||
|
color: $u-primary-dark;
|
||
|
}
|
||
|
|
||
|
.count {
|
||
|
border-color: $u-primary-dark;
|
||
|
}
|
||
|
</style>
|