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

鍍金池/ 問答/ HTML問答
久不遇 回答

js沒有權(quán)限操作文件系統(tǒng),你可以用node.js的fs.writeFile()來實現(xiàn)

心上人 回答

URI部分用encodeURI,參數(shù)部分用encodeURIComponent,這樣才是相對完美的編碼方式。

比如`https://example.com/?next=abc...`,得到的結(jié)果分別是:

encodeURI(`https://example.com/?next=abc...`):

"https://example.com/?next=abc.com/def&encoding=utf-8"

encodeURIComponent(`https://example.com/?next=abc...`):

"https%3A%2F%2Fexample.com%2F%3Fnext%3Dabc.com%2Fdef%26encoding%3Dutf-8"

encodeURI(https://example.com/?next=${encodeURIComponent('abc.com/def')}&encoding=${encodeURIComponent('utf-8')}):

"https://example.com/?next=abc.com%252Fdef&encoding=utf-8"

懶得改了,最后的 ` 自己腦補吧

互擼娃 回答

dll打包配置教程,望有助,親測可用,我寫的~~哈哈哈

安若晴 回答

直接跳轉(zhuǎn)到目標(biāo)行可以嗎?在window下(ps:..沒有MAC),ctrl+p然后輸入:1回車就可以跳到相應(yīng)的行數(shù)了

兮顏 回答

啥編輯器啊,像webstorm這種自動保存的編輯器,由于其保存機制(并沒有一開始就寫入文件,而是存入內(nèi)存?可能是內(nèi)存)的問題可能導(dǎo)致node檢測不到文件變化(因為根本就沒變),會無法熱更新,如果是手動報錯的,那就不清楚了。

笨小蛋 回答
// router.js
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export function createRouter () {
  return new Router({
    mode: 'history',
    routes: [
      { path: '/', component: () => import('./components/Home.vue') },
      { path: '/item/:id', component: () => import('./components/Item.vue') }
    ]
  })
}
擱淺 回答

clipboard.png

你這個不是數(shù)組結(jié)構(gòu),是對象結(jié)構(gòu),把他改成對象就可以了

{
'0': {id: '',...},
'1': {id: '',...},
}

大濕胸 回答

1.第三方的資源直接采用cdn的形式鏈接就可以了,公共的js可以采用 new webpack.optimize.CommonsChunkPlugin,其中可以用minChunks來指定公共代碼的引用次數(shù)。
2.你的多頁面應(yīng)該是根據(jù)html-webpack-plugin插件指定某個模版來生成多個html的吧?只要在模版上注入cdn的資源就行了.

薄荷綠 回答

下面展示了在Quill中如何自定義FileBlot以完成文件上傳與回顯功能

  • 自定義FileBlot
可參考例子:https://quilljs.com/guides/cl...
  var Quill = require('quill/dist/quill.js')
  var Link = Quill.import('formats/link');
  class FileBlot extends Link {  // 繼承Link Blot
    static create(value) {
      let node = undefined
      if (value&&!value.href){  // 適應(yīng)原本的Link Blot
        node = super.create(value);  
      }
      else{  // 自定義Link Blot
        node = super.create(value.href);  
        node.setAttribute('download', true);  // 左鍵點擊即下載
        node.innerText = value.innerText;
      }
      return node;
    }
  }
  FileBlot.blotName = 'link';
  FileBlot.tagName = 'A';
  Quill.register(FileBlot);
  • 調(diào)用自定義Blot
// 當(dāng)點擊quill中上傳文件的button后調(diào)用
// 這里url是先上傳文件后從服務(wù)器返回的文件資源地址
insertToEditor(url, file, editor) {
    const range = editor.getSelection();
    if(/^image/.test(file.type)){  // image直接插入image標(biāo)簽顯示
      editor.insertEmbed(range.index, "image", url);
    }
    else{  // file則顯示名為filename的A標(biāo)簽
      editor.insertEmbed(range.index, 'link', {href:url, innerText:file.name}, "api")
    }
}
  • 示例結(jié)果

圖片描述

祉小皓 回答

如果是跨域問題,即出現(xiàn)

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://api.douban.com' is therefore not allowed access.

那么有兩種方式可以試一下

  1. 由后端代理轉(zhuǎn)發(fā)請求

  2. 前端jsonp,可以使用這個庫https://github.com/axios/axio...

$ npm install jsonp --save
var jsonp = require('jsonp');
jsonp('http://www.example.com/foo', null, function (err, data) {
  if (err) {
    console.error(err.message);
  } else {
    console.log(data);
  }
});

如果不是跨域問題,只是想發(fā)起get請求,看看官網(wǎng)……
https://github.com/axios/axios/

遺莣 回答

樓上的正則表達(dá)式只對你這一個例子適用,更具體的講,它只在路由參數(shù)只有兩個并且 p 是第一個的情況下適用。

js 里的正則是不支持判斷“前面是 p=”這種條件的,所以要讓結(jié)果完全只有 111 沒有 p= 出現(xiàn)是不可能的。
但是有一種替代方案,只需要將你原來的正則稍微修改一點就可以實現(xiàn):

url.match(/p=(\d+)(?=[&$])/);
// ["p=111", "111"]

這個數(shù)組的第二項就是你想要的東西。
這個正則表達(dá)式中,(\d+) 的括號會將括住的部分放進(jìn)返回結(jié)果里。
另外注意我將你的 (?=[&]) 補充成了 (?=[&$]),這是要考慮 p 是最后一個參數(shù)的情況

希望對你有幫助

陪妳哭 回答

在main.js里面可以實例化 不過代碼太臃腫
可以拆分出來 單獨寫一個文件夾router/index.js 下面去實例化一個router
然后mainJS里面引入這個js就可以了

逗婦惱 回答

在actions里用axios的話,直接引入就好了import 'axios'
獲取state里的數(shù)據(jù)也可以直接引state,不過一般都是接收外面?zhèn)鬟^來的參數(shù)

改變state值當(dāng)然是通過mutations改變了,通過actions里的context.commit嗲用mutations里的方法(可以把參數(shù)傳過去),在mutations里改state

actions:

import axios form 'axios'

const actions = {
  setMutation (context, params) {
    axios.get(params.url, {params: params})
    .then(res => {
        context.commit('setInfo', res.info)
    })
  }
}

export default actions

mutations:

const mutations = {
    setInfo (state, params) {
        state.info = params.info
    }
}

export default mutations