鍍金池/ 問(wèn)答/ HTML問(wèn)答
router.beforeEach((to, from, next) => {
  // ...
})

參見(jiàn) https://router.vuejs.org/zh-c...

雅痞 回答

得先把rxjs的包引進(jìn)來(lái)

尐潴豬 回答

已解決,套個(gè)<div class="container">,設(shè)置樣式.container{overflow: auto}即可

舊言 回答

nodejs的Promise沒(méi)有pipe方法,所以建議你看看rp的源代碼

入她眼 回答

首先非常簡(jiǎn)單的是 如果你是用的是axios 那么可以這么做
使用axios的攔截處理

import axios     from 'axios'
import qs        from 'qs'
// 這里是你想要loading的動(dòng)畫 這里我先用antd-mobile演示
import { Toast } from 'antd-mobile';
// 簡(jiǎn)單的設(shè)置超時(shí)時(shí)間
axios.defaults.timeout = 10000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'

// 請(qǐng)求攔截
axios.interceptors.request.use(config => {
        // 進(jìn)行l(wèi)oading動(dòng)畫
        Toast.loading('請(qǐng)求數(shù)據(jù)中...', 0)

        if (config.method === "post" || config.method === "put" || config.method === "delete") {
            // 序列化
            config.data = qs.stringify(config.data);
        }
        return config;
    },
    // 請(qǐng)求發(fā)生錯(cuò)誤
    error => {
        // 在這里處理你想要做的錯(cuò)誤處理 比如 出現(xiàn)重新加載等等... 
        // 一旦捕獲錯(cuò)誤 就給redux設(shè)置一個(gè)全局狀態(tài)  當(dāng)然狀態(tài)根據(jù)你的業(yè)務(wù)需求自己定義 比如 1代表 xx 2 代表xx  根據(jù)redux不同狀態(tài)去做不同事情
        // ...somecode 
        
        // 拋出錯(cuò)誤信息
        return Promise.reject(error.data.error.message);
    });

// 響應(yīng)攔截
axios.interceptors.response.use(config => {
    // 取消掉loading
    Toast.hide()
    return config
})

// 請(qǐng)求封裝
export default function fetch(url, params = {}, method = 'get') {
    // 處理不同請(qǐng)求方式的傳參格式
    if (method === 'get') {
        params = {params}
    }
    return new Promise((resolve, reject) => {

        axios[method](url, params).then(res => {

            // 不為 0 拋出提示 =>  這里我后端定義的是 0 即時(shí)正常數(shù)據(jù) 
            // 請(qǐng)根據(jù)你的實(shí)際應(yīng)用拋出的錯(cuò)誤進(jìn)行調(diào)整 此時(shí)你也應(yīng)該用redux 設(shè)置全局狀態(tài) 進(jìn)行你想要的業(yè)務(wù)需求 比如出現(xiàn)按鈕
            res.data.code && Toast.info(res.data.msg, 1, null, true)
                
            resolve(res.data)


        }).catch(error => {
        // 接口異常 進(jìn)行處理
           // ...somecode
            reject(error)
        })
    })
}

如上 捕獲超時(shí)時(shí)間 捕獲接口錯(cuò)誤信息 以及捕獲請(qǐng)求發(fā)送錯(cuò)誤 然后設(shè)置redux 即可

逗婦惱 回答

不知道你是用什么來(lái)展示PDF的, 我們用pdf.js顯示PDF時(shí),為了提供性能,用了service worker。

女流氓 回答

js不支持positive lookbehind,覺(jué)得這樣的結(jié)果是因?yàn)檎齽t表達(dá)式對(duì)象無(wú)視了不認(rèn)識(shí)的(?<=)以及之后的所有表達(dá)式,所以只匹配了一個(gè)a

離魂曲 回答

1.確實(shí)是的,操作dom時(shí)vue的性能有點(diǎn)浪費(fèi),
2.除了樓上說(shuō)的這種原生實(shí)現(xiàn)方法,還可以借用element插件的indeterminate 狀態(tài)來(lái)實(shí)現(xiàn)復(fù)選效果,http://element.eleme.io/#/zh-...

不是很明確問(wèn)的問(wèn)題,試著寫兩句

異步

瀏覽器可以繼續(xù)操作

同步

瀏覽器被阻塞,必須等請(qǐng)求完成才能操作

//代碼解釋:
for (var i = 0; i < 5; i++) {
    //異步效果
    console.log(i);

    //同步效果
    //alert(1);
}

同步異步是瀏覽器提供的接口方式,jQuery只是調(diào)用API,并非jQuery來(lái)實(shí)現(xiàn)異步

囍槑 回答

那就要看你在閱讀原文里放的是啥了,單看截圖的話,沒(méi)猜錯(cuò)應(yīng)該是在wx.error里寫了個(gè)alert,還是建議用vConsole打log的方式來(lái)排錯(cuò)吧。

毀了心 回答

你可以把后面的\bin去了試試~

具體可以看這里:https://github.com/gorkem/vsc...

The path to the Java Development Kit is searched in the following order:

the java.home setting in VS Code settings (workspace then user settings)
the JDK_HOME environment variable
the JAVA_HOME environment variable
on the current system path
  • 配置JDK_HOMEJAVA_HOME
  • VS 中設(shè)置java.home之后重啟 VS
青黛色 回答

config index.js中設(shè)置

    proxyTable: {
      '/api': {
        target: 'url',
        changeOrigin: true,
        pathRewrite: {
          '^/api': 'api'
        }
      },
      '/img': {
        target: imgUrl,
        changeOrigin: true,
        pathRewrite: {
          '^/img': 'img'
        }
      }
    }
怪痞 回答

hexo generate有一個(gè)watch參數(shù),source/_post中的md文件有改動(dòng),就會(huì)自動(dòng)publish
hexo generate --watch >> /tmp/hexo_deploy.log 2>&1 &

墨沫 回答
this.$refs[form1].validate(function (valid) {
    if (valid) {
        document.querySelector('.loginDiv>section').style.transform = 'translateY(-' + 3 * height + 'px)';
    }
});

但這個(gè)事情,因該交給babel去做,

夏木 回答

你是想問(wèn)不用nodejs不用es6,怎么使用vue這些嗎?

舊酒館 回答
.opacity(@number){
  /* older safari/Chrome browsers */
  -webkit-opacity: @number/100;
  /* Netscape and Older than Firefox 0.9 */
  -moz-opacity: @number/100;
  /* Safari 1.x (pre WebKit!) 老式khtml內(nèi)核的Safari瀏覽器*/
  -khtml-opacity: @number/100;
  /* IE9 + etc...modern browsers */
  opacity: @number/100;
  /* IE 4-9 */
  filter:alpha(opacity=@number);
  /*This works in IE 8 & 9 too*/
  -ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=@number);
  /*IE4-IE9*/
  filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=@number);

}
櫻花霓 回答

ionic 3 有Events事件通知系統(tǒng),你可以使用這個(gè)來(lái)進(jìn)行事件訂閱和通知,從而把數(shù)據(jù)更新。用法很簡(jiǎn)單的。

逗婦乳 回答

vue 1.X webpack 1.X

如果你是最近在學(xué)的。建議不要太糾結(jié)這個(gè)環(huán)境的問(wèn)題,直接用vue-cli來(lái)搭建開(kāi)發(fā)環(huán)境。

另外你這個(gè)

  1. 先看一下css有沒(méi)有加載進(jìn)來(lái)。
  2. 覺(jué)得應(yīng)該是webpack配置 css那一部分出了問(wèn)題。
毀憶 回答
wangEditor 從v3版本開(kāi)始不支持 textarea ,但是可以通過(guò)onchange來(lái)實(shí)現(xiàn) textarea 中提交富文本內(nèi)容。
<div id="div1">
    <p>歡迎使用 <b>wangEditor</b> 富文本編輯器</p>
</div>
<textarea id="text1" style="width:100%; height:200px;"></textarea>

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="../wangEditor.js"></script>
<script type="text/javascript">
    var E = window.wangEditor
    var editor = new E('#div1')
    var $text1 = $('#text1')
    editor.customConfig.onchange = function (html) {
        // 監(jiān)控變化,同步更新到 textarea
        $text1.val(html)
    }
    editor.create()
    // 初始化 textarea 的值
    $text1.val(editor.txt.html())
</script>