在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答

||判斷測試可以

<tabbar v-show="$route.path == '/index' || $route.path == '/storeCenter' || $route.path == '/explore' || $route.path == '/me'" slot="bottom">
      <tabbar-item link="/index" :selected="$route.path == '/index'">
        <span slot="icon" class="iconfont icon-home"></span>
        <span slot="label">首頁</span>
      </tabbar-item>
      <tabbar-item link="/storeCenter" :selected="$route.path == '/storeCenter'">
        <span slot="icon" class="iconfont icon-store"></span>
        <span slot="label">門店</span>
      </tabbar-item>
      <tabbar-item link="/explore" :selected="$route.path == '/explore'">
        <span slot="icon" class="iconfont icon-search"></span>
        <span slot="label">發(fā)現(xiàn)</span>
      </tabbar-item>
      <tabbar-item show-dot link="/me" :selected="$route.path == '/me'">
        <span slot="icon" class="iconfont icon-wode"></span>
        <span slot="label">我的</span>
      </tabbar-item>
    </tabbar>
柚稚 回答

所有以前的jquery可以實現(xiàn)的功能用vue可以用更有效簡單的方法實現(xiàn)。原理都是一樣的。
正好前幾天我寫一個公司網(wǎng)站用到了導(dǎo)航,下面是我寫的代碼,代碼量很少。

//導(dǎo)航平滑滾動
export default {
        name: 'Main',
        data() {
            return {
                msg: 'Welcome to Your Vue.js App'
            }
        },
        components: {
            "top": Top,
            "official": Official,
            "wechat": Wechat,
            "payment": Payment,
            "category": Category,
            "mall": Mall,
            "cater": Cater,
            "wechat-pay": WechatPay,
            "little": Little,
            "crm": Crm,
            "adv": Adv,
            "contact": Contact,
            "my-footer": MyFooter,
            "loading": Loading
        },
        computed: {
            // 計算屬性的 getter
            heightNum: function () {
                return 1;
            },
            position: function () {
                let position = this.$store.getters.getPosition;
                console.log(position);
                let height = this.$refs[position].offsetTop;
                let scrollTopValue = this.$refs[position].scrollTop;
                this.$store.commit('changeHeight', height);
                this.$store.commit('changeScroll', scrollTopValue);
                return position;
            }
        },
        mounted: function () {
            this.$nextTick(function () {
                // Code that will run only after the
                // entire view has been rendered
                window.addEventListener('scroll', this.changeActive);
                this.getOffsetTop();
                this.getScrollTop();
            })
        },
        methods: {
            greet: function (event) {
                // `this` 在方法里指向當(dāng)前 Vue 實例
                alert('Hello ' + this.name + '!')
                // `event` 是原生 DOM 事件
                if (event) {
                    alert(event.target.tagName)
                }
            },
            scrollTo: function (data) {
                let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
                let des = this.$refs[data].offsetTop;
                let start = this.$refs[data].scrollTop;
                this.moveSlowly(des, start);
            },
            moveSlowly: function (des, start, time) {
                clearInterval(timer);
                let speedTime = time || 100;
                start || (start = 0);
                let distance = des - start;
                let speed = distance / speedTime;
                let i = 1;
                let pos = start;
                let timer = setInterval(function () {
                    if (i == speedTime) {
                        pos = des;
                        document.documentElement.scrollTop = document.body.scrollTop = pos;
                        clearInterval(timer);
                    } else {
                        pos = pos + speed;
                        document.documentElement.scrollTop = document.body.scrollTop = pos;
                        i++;
                    }
                }, 1)
            },
            changeActive: function () {
                let top = this.$refs.top.offsetTop;
                let wechat = this.$refs.wechat.offsetTop;
                let category = this.$refs.category.offsetTop;
                let contact = this.$refs.contact.offsetTop;
                let scrollY = this.scrollY();
                this.remove_active();
                (scrollY > 0 && scrollY < 500) && (this.$refs.navTop.className = 'active');
                (scrollY > wechat && scrollY < (category)) && (this.$refs.navWechat.className = 'active');
                (scrollY > category && scrollY < (contact)) && (this.$refs.navCategory.className = 'active');
                (scrollY > contact && scrollY < (contact + 500)) && (this.$refs.navContact.className = 'active');
            },
            remove_active: function () {
                this.$refs.navTop.className = '';
                this.$refs.navWechat.className = '';
                this.$refs.navCategory.className = '';
                this.$refs.navContact.className = '';
            },
            // 滾動條高
            scrollY: function () {
                return document.documentElement.scrollTop || document.body.scrollTop;
            },
            getOffsetTop: function () {
                let service = this.$refs.service.offsetTop;
                let offsetTop = new Object();
                offsetTop.mall = this.$refs.mall.offsetTop + service;
                offsetTop.cater = this.$refs.cater.offsetTop + service;
                offsetTop.wechatpay = this.$refs.wechatpay.offsetTop + service;
                offsetTop.little = this.$refs.little.offsetTop + service;
                offsetTop.crm = this.$refs.crm.offsetTop + service;
                offsetTop.adv = this.$refs.adv.offsetTop + service;
                this.$store.commit('changeOffsetTop', offsetTop);
            },
            getScrollTop: function () {
                let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
                let scrollTopLen = new Object();
                scrollTopLen.mall = this.$refs.mall.scrollTop;
                scrollTopLen.cater = this.$refs.cater.scrollTop;
                scrollTopLen.wechatpay = this.$refs.wechatpay.scrollTop;
                scrollTopLen.little = this.$refs.little.scrollTop;
                scrollTopLen.crm = this.$refs.crm.scrollTop;
                scrollTopLen.adv = this.$refs.adv.scrollTop;
                this.$store.commit('changeScrollTop', scrollTopLen);
            }
        }
    }
</script>
陪我終 回答

你這個寫法本身就有問題吧。。。追求性能之前,請先確保結(jié)果正確

黑與白 回答

str.substring(0,str.length-2)

初念 回答

你把正則換成 r'_\d+' 就可以了。

不能pull和push,建議重新add和commit,再重新pull和commit

不討囍 回答

可能后端的文件流有問題

離殤 回答

已找到解決方案,不能用導(dǎo)航標(biāo)簽,直接用view綁定方法跳轉(zhuǎn)。

空白格 回答

那你應(yīng)該使用 context.store,把共享數(shù)據(jù)放到倉庫里

瞄小懶 回答

你的 a.jsb.js 怎么寫的?

你這種用法:import a from './a'
對應(yīng)的a.js 應(yīng)該有export defaut

如果沒有 default,
應(yīng)該這樣用:import {a} from './a'

故人嘆 回答
本系列文章所講解內(nèi)容,依賴于https://github.com/icarusion/... 這套架構(gòu)
黑與白 回答

你的應(yīng)用是8142端口,你用nginx代理就不要用這個端口了啊,換個端口

選擇 回答

第一個報錯是說你用的react是開發(fā)環(huán)境的react,真正用在線上環(huán)境打包時可以通過跳過一些步驟來讓打包變得更快。
第二個是打包redux沒設(shè)置node環(huán)境,可以在webpack.config里,在plugin添加

new webpack.DefinePlugin({
    'process.env':{
        'NODE_ENV': JSON.stringify('production')
    }
})

可以解決你的第前兩個報錯
第三個報錯就真的是你的代碼問題了,可能是對數(shù)據(jù)沒有進(jìn)行判斷

汐顏 回答

store里面vue小寫了。。。蠢比問題

涼汐 回答
        *{
            padding: 0;
            left: 0;
        }
        body{
            padding-top: 50px;
        }
        .header{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background-color: red;
            z-index: 10001;
        }
        .layout{
            display: flex;
            position: relative;
        }
        .layout .layout-left{
            flex: 0 0 200px;
            flex-direction:column;
            width: 200px;
            color: #fff;
            background-color: blue;
        }
        .layout .layout-right {
          background-color: yellow;
          overflow-y: auto;
          overflow-x: hidden;
          position: absolute;
          left:215px;
          top: 0;
          bottom: 0;
          right: 0;
          margin: auto;
      }
孤毒 回答

已解決,,自己進(jìn)入誤區(qū)了;報錯原因?qū)嶋H上就是生產(chǎn)模式下請求的地址沒有設(shè)置好,因為調(diào)用了cnodejs的api,開發(fā)模式下使用了代理;生產(chǎn)模式下需要將請求地址更改為:https://cnodejs.org/api/v1;
具體操作就是在config文件下對dev.env.js和prod.env.js增加默認(rèn)地址前綴:
dev.env.js:
圖片描述

prod.env.js:
圖片描述

在發(fā)送請求時依據(jù)模式調(diào)用:
圖片描述

具體可參考這篇博客:鏈接描述