|
[开发工具]
avm 的vif 的样式切换有严重问题
[复制链接]
说明: 就使我先页面加载的时候,属于样式1,内容是默认背景色为白色,只是设置了宽高,没有特别设置背景色, 然后点击一个按钮,变成样式2,也就是背景色变黑,然后再点击 样式1 按钮, 然后这个时候,属于样式2的背景色居然还存在,并没有被去除元素
- <template>
- <view class="page">
- <safe-area></safe-area>
- <button class="" @click="test(1)">样式1</button>
- <button class="" @click="test(2)">样式2</button>
- <view v-if="active == 1" class="test1"></view>
- <view v-if="active == 2" class="test2"></view>
- </view>
- </template>
- <script>
- export default {
- name: 'home_frm',
- install() {
- if (api.platform == 'app') {
- api.setStatusBarStyle({
- style: 'dark'
- });
- }
- },
- apiready() {//like created
- },
- data() {
- return {
- active: 1
- }
- },
- methods: {
- test(index) {
- this.data.active = index;
- }
- }
- }
- </script>
- <style>
- .test2 {
- background: #000;
- width: 100%;
- height: 300px;
- }
- .test1 {
- width: 100%;
- height: 300px;
- }
- .page {
- width: 100%;
- height: 100%;
- }
- </style>
复制代码
|
|