| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <div class='browse'>
- <div>
- <img src="@/assets/img/logo.png" alt="">
- <span class="line"></span>
- <img src="@/assets/img/eye.png" alt="">
- <span class="txt">{{myMoods}}访问量</span>
- </div>
- </div>
- </template>
- <script>
- export default {
- name:'browse',
- components: {},
- data() {
- //这里存放数据
- return {
- myMoods:0
- };
- },
- //监听属性 类似于data概念
- computed: {},
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- fetch("http://47.112.166.173:8109/api/count/saveVisit/" + window.number)
- .then((response) => response.json())
- .then((data) => {
- this.myMoods = data.data.visitSum;
- // console.log(data)
- });
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- }
- </script>
- <style lang='less' scoped>
- .browse{
- position: fixed;
- top: 30px;
- left: 40px;
- z-index: 999;
- &>div{
- display: flex;
- align-items: center;
- }
- .line{
- margin: 0 15px;
- display: inline-block;
- width: 2px;
- height: 30px;
- background-image: linear-gradient(rgba(255,255,255,.3), rgba(255,255,255));
- }
- .txt{
- color: #fff;
- margin-left: 10px;
- }
- }
- </style>
|