鍍金池/ 問答
瘋浪 回答

圖片描述
script: [

// {type: 'text/javascript',innerHtml: ` console.log(1\>0) ` }

]

重點在于 **\** 這個符號 就是回車建上面的那個建,你可以試試看

呆萌傻 回答

看題主的描述,估計對angular都沒有一個基本的了解,我建議先把a(bǔ)ngular的基礎(chǔ)知識過一下,至于你的問題是很容易解決的,angular是組件化的,就比如你的footer模板已經(jīng)寫好了,你想到處復(fù)用它,那你可以新建一個footer組件,然后把你寫好的模板內(nèi)容拷到tooter組件的模板上去,在根模塊注冊好這個組件,然后在其它的頁面上都可以引用這個組件了

扯不斷 回答

cdn 版本的 element-ui 設(shè)置的全局變量是 ELEMENT

externals: {
  'element-ui': 'ELEMENT',
}
爆扎 回答

因為做目錄時,使用了el-scrollbar,為了防止出現(xiàn)橫向滾動條,增加了
.el-scrollbar__wrap {

overflow-x: hidden;

}
導(dǎo)致這個問題

孤星 回答

你的baseUrl感覺有問題,以下是我們的做法給你參考:

common.js里面的公用方法:
exports.bundleUrl = function (self) {

var bundleUrl = self.$getConfig().bundleUrl;
return bundleUrl;

};
//判斷系統(tǒng),安卓返回'android',ios返回'iOS',h5返回'web'
exports.androidOrIos = function (self) {

return self.$getConfig().env.platform;

};
//獲取url地址
exports.getBaseUrl = function (self) {

var androidOrIos = this.androidOrIos(self);
var bundleUrl = this.bundleUrl(self);
var isHttp = bundleUrl.indexOf('http://') >= 0;
var nativeBase;
if (isHttp) {
    var i = bundleUrl.indexOf('/dist/');
    nativeBase = bundleUrl.slice(0, i) + '/dist/';
} else {
    if (androidOrIos == 'android') {
        nativeBase = 'file://assets/dist/';
    } else if (androidOrIos == 'iOS') {
        nativeBase = bundleUrl.substring(0, bundleUrl.lastIndexOf('dist/') + 5);
    } else {
        var host = 'localhost:12580';
        var matches = /\/\/([^\/]+?)\//.exec(bundleUrl);
        if (matches && matches.length >= 2) {
            host = matches[1];
        }
        nativeBase = 'http://' + host + '/example/build/';
    }
}

var h5Base = './index.html?page=./example/build/';

// in Native
var base = nativeBase;
if (typeof window === 'object') {
    base = h5Base;
}
return base;

};
//跳轉(zhuǎn)到指定url頁面
/**
*url 請求地址,前綴已添加,為baseUrl,傳值如:'login/login';
*param為需帶參數(shù),傳值如:'name1=value1&name2=value2'
*callback為回調(diào)函數(shù),傳值如:function(){};
**/
exports.jump = function (self, url, param, callback) {

var navigator = weex.requireModule('navigator');
var baseUrl = this.getBaseUrl(self);
var param = param ? param : '';
var url = {'url': baseUrl + url + '.js?' + param, 'animated': 'true'};
navigator.push(url, function (e) {
    if (callback) {
        typeof callback == 'function' && callback(res);
    }
});

}

在頁面調(diào)用:
import common from './common/common';
export default {

methods: {
    toTest() {
        common.jump(this, 'test/test');
    }
}

}

紓惘 回答
let upName = '上車點一'
let downName = '下車點二'

data.filter((item) => {
  for (let i in item.line) {
    if (item.line[i].type === 'up' && item.line[i].place === upName) {
      return true
    }
  }
}).filter((item) => {
  for (let i in item.line) {
    if (item.line[i].type === 'down' && item.line[i].place === downName) {
      console.log('合適路線' + item.name)
      return true
    }
  }
})

可以么

網(wǎng)妓 回答

代碼沒有編譯吧

絯孑氣 回答

v-if/v-elsev-show不就完了么...

舊言 回答

<form action="https://www.baidu.com&quot; method="get"></form>

加上method="get"

話寡 回答

解決方案參考我的多頁腳手架:https://github.com/dailynodej...

chainWebpack: config => {
    config.module
      .rule('css')
        .test(/\.css$/)
        .oneOf('vue')
        .resourceQuery(/\?vue/)
        .use('px2rem')
          .loader('px2rem-loader')
          .options({
            remUnit: 75
          })
  }

loaderOptions 里面是不能配置的,沒有這個項,源碼 cli-service/lib/options.js

loaderOptions: joi.object({
      css: joi.object(),
      sass: joi.object(),
      less: joi.object(),
      stylus: joi.object(),
      postcss: joi.object()
    })
不將就 回答

可以試一試使用eslint,prettier插件實現(xiàn)自定義格式化

初心 回答

書簽,在所在行按快捷鍵Ctrl+Shift+任意數(shù)字,就可以插入一個標(biāo)簽了,要將光標(biāo)跳轉(zhuǎn)到某個書簽,只需要Ctrl+對應(yīng)的標(biāo)簽數(shù)字。

遺莣 回答

你的藍(lán)色部分用的是overflow: auto或者scroll吧,這將會導(dǎo)致這部分滑動的時候,頁面其他部分不會隨滾動條滾動。你可以用js監(jiān)聽藍(lán)色部分的滑動事件,來實現(xiàn)

可以把部分?jǐn)?shù)據(jù)提取出來,放到對象列表中,然后使用 map 函數(shù)連接,而不用顯示出所有類似的結(jié)構(gòu)。

<div className={'one_tag_div'}>
    <div
        style={vulgarTagStyle}
        className={'one_tag_left'}
    >

    </div>
    <div className={'one_tag_right'}>{tagsName[0]}</div>
</div>
<div className={'one_tag_div'}>
    <div
        className={'one_tag_left'}
        style={bloodyTagStyle}
    >

    </div>
    <div
        className={'one_tag_right'}
    >{tagsName[1]}</div>
</div>
<div className={'one_tag_div'}>
    <div
        className={'one_tag_left'}
        style={sexTagStyle}
    >

    </div>
    <div
        className={'one_tag_right'}
    >{tagsName[2]}</div>
</div>
<div className={'one_tag_div'}>
    <div
        className={'one_tag_left'}
        style={illegalTagStyle}>

    </div>
    <div
        className={'one_tag_right'}
    >{tagsName[3]}</div>
</div>
<div className={'one_tag_div'}>
    <div
        className={'one_tag_left'}
        style={politicsTagStyle}
    >

    </div>
    <div
        className={'one_tag_right'}
    >{tagsName[4]}</div>
</div>
</div>
澐染 回答

修改請求頭可以配置一下axios

//創(chuàng)建實例 axios.create([config])
const instance=axios.create({
  // `timeout` 指定請求超時的毫秒數(shù)(0 表示無超時時間)
  timeout:2000,
  // `headers` 是即將被發(fā)送的自定義請求頭
  headers:{
    'Content-Type':'application/x-www-form-urlencoded'
  }
});
故人嘆 回答

有復(fù)制node_module文件夾么?如果有。刪掉直接npm install

誮惜顏 回答
提問前,代碼請勿使用圖片

假設(shè)你的兩個promise分別是 Func1()Func2()

let pr_task = [Func1,Func2];
Promise.all(pr_task).then(function(){
    //Here,code  After All Promise
})

根據(jù)問題的補(bǔ)充

fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=1',
    ).then((response)=>
        response.json()
    ).then((res)=>{
        console.log(res[0].name);
    });
fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=2',
    ).then((response)=>
        response.json()
    ).then((res)=>{
        console.log(res[0].name);
    })

如果你是想等 fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=1'),那么直接

let pr_task = [];
pr_task.push(fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=1'))
pr_task.push(fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=2'))

Promise.all(pr_task).then(function(){
    //Here,code  After All Promise
})

只要保證pr_task這個數(shù)組的值都是一個promise,那么Promise.all()就會等待所有的數(shù)據(jù),并且按照原數(shù)組的順序給出resolve的結(jié)果組成的一個數(shù)組