<template>
  <view class="content">
    <button type="primary" @click="saveData">存储数据</button>
    <button type="primary" @click="getData">获取数据</button>
    <view style="margin-top: 50rpx">
      <hello></hello>
      <some-one v-if="showSomeHide"></some-one>
    </view>
	<button type="primary" @click="hideSome" style="margin-top: 50rpx">影藏someone</button>
  </view>
</template>

<script>
import hello from '../../components/hello/hello.vue';
import SomeOne from '../../components/someOne/someOne.vue';



export default {
  components: { hello, SomeOne },
 
  
  
  data() {
    return {
		showSomeHide:true
	};
  },
  
  methods: {
    saveData() {
      uni.setStorage({
        key: "user",
        data: {
          id: 3241354,
          name: "asdfasf",
          age: 18,
          sex: "男",
        },
        success() {
          console.log("success");
        },
        fail(err) {
          console.log(err);
        },
      });
    },
    getData() {
      uni.getStorage({
        key: "user",
        success(res) {
          console.log(res);
        },
        fail(err) {
          console.log(err);
        },
      });
    },
	hideSome(){
		this.showSomeHide = !this.showSomeHide
	},
  },
};
</script>

<style>
.content {
  margin: 20rpx;
}
</style>
