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

鍍金池/ 問(wèn)答/ HTML問(wèn)答
孤星 回答
<script>
    import xx from '/static/xx.js'
<script>
<style>
    @import "xx.css";
</style>
法克魷 回答

MainCtrl 指的是你引入的一個(gè)類,public 定義了一個(gè)變量的性質(zhì),這里是公共的,mainCtrl是MainCtrl 的一個(gè)實(shí)例

疚幼 回答

仔細(xì)閱讀webpack-DevServer文檔,可以發(fā)現(xiàn)發(fā)現(xiàn)配置中加入index: '',即可代理根目錄,所以只需在代理中再配置一個(gè)根目錄,代碼如下

const cookieMap = {};
module.exports = {
  devServer: {
    index: '',// specify to enable root proxying
    historyApiFallback: true,
    hot: true,
    inline: true,
    progress: true,
    openPage: 'login',
    proxy: [ {
      context: ['/api'],
      target: "http://api.example.com",
      changeOrigin: true,
      onProxyReq(proxyReq, req, res) {
        let cookie = cookieMap[req.get('User-Agent')] || '';
        proxyReq.setHeader('Cookie', cookie);
      }
    }, {
      context: ['/login'],
      target: "http://login.example.com",
      changeOrigin: true,
      onProxyRes(proxyRes, req, res) {
        if(proxyRes.statusCode === 302) {
          if(proxyRes.headers['set-cookie']) {
            cookieMap[req.get('User-Agent')] = proxyRes.headers['set-cookie'].join(';');
          }
          proxyRes.headers['Location'] = '/';
        }
      }
    }, {
      context: ['/'],
      bypass: function(req, res, proxyOptions) {
        if (req.url === '/' && !cookieMap[req.get('User-Agent')]) {
          res.redirect('/login');
          return true;
        }
      }
    }]
  }
}
未命名 回答

你可以這樣來(lái)做

做個(gè)下拉列表框

分別有 手機(jī)、座機(jī)、郵箱 三個(gè)選項(xiàng)

這樣就實(shí)現(xiàn)了三選一了

后面跟一個(gè)文本框、根據(jù)客戶選擇的驗(yàn)證那一項(xiàng)就OK了

默念 回答

可以這樣做,用兩層reduce來(lái)實(shí)現(xiàn):


(() => {
  let a = [{list: [1, 2, 3]}, {list: [4, 5, 6]}]
  let aIm = Immutable(a)

  aIm = aIm.reduce((aIm, item, index) =>
    aIm.updateIn([index, 'list'], add), aIm)

  function add (arr) {
    return arr.reduce((arr, item, index) =>
      arr.updateIn([index], plus), arr)
  }

  function plus (x) {
    return x + 1
  }

  console.log(aIm)
})()
失魂人 回答

沒(méi)返回ctx.body嗎

練命 回答
import pandas as pd

def csv_to_xlsx_pd(csv_pt, encoding='utf-8'):
    csv = pd.read_csv(csv_pt, encoding=encoding)
    csv.to_excel(csv_pt.split('.')[0]+'.xlsx', sheet_name='data')

# TODO 批量處理目錄下的文件 os.listdir

if __name__ == '__main__':
    csv_to_xlsx_pd()
孤星 回答

其實(shí)就是瀏覽器的瀏覽緩存,兩種解決辦法:
一就是在連接上添加每次都會(huì)變化的隨機(jī)數(shù)
二就是禁用緩存,參考 http協(xié)議的Cache-Control

初念 回答

echarts版本問(wèn)題,高版本的是這樣,可以換成3.6以下的,或者改下formatter里的代碼

舊言 回答

找到方法了

既然是開(kāi)發(fā)環(huán)境配置,估計(jì)和devServer有關(guān),查看了webpack4官網(wǎng)關(guān)于devServer的部分,找到了devServer.historyApiFallback

看到了這部分

module.exports = {
  //...
  devServer: {
    historyApiFallback: {
      rewrites: [
        { from: /^\/$/, to: '/views/landing.html' },
        { from: /^\/subpage/, to: '/views/subpage.html' },
        { from: /./, to: '/views/404.html' }
      ]
    }
  }
};

恍然大悟,對(duì)于特定路由,可以指定靜態(tài)資源。
所以把vue.config.js 改為了如下

module.exports = {
  devServer: {
    port: 3007,
    host: 'localhost',
    open: true,
    historyApiFallback: {
      rewrites: [
        { from: /^\/login/, to: '/login.html' },
      ]
    },
    proxy: {
      '/api': {
        target: 'localhost: 3333',
        changeOrigin: true,
        // ws: true,
        pathRewrite: {
          '^/api': '/api'
        }
      }
    }
  },
  chainWebpack: config => {
  },
  pages: {
    index: {
      // page 的入口
      entry: 'src/main.js',
      // 模板來(lái)源
      template: 'public/index.html',
      // 在 dist/index.html 的輸出
      filename: 'index.html',
      // 當(dāng)使用 title 選項(xiàng)時(shí),
      // template 中的 title 標(biāo)簽需要是 <title><%= htmlWebpackPlugin.options.title %></title>
      title: 'Index Page',
      // 在這個(gè)頁(yè)面中包含的塊,默認(rèn)情況下會(huì)包含
      // 提取出來(lái)的通用 chunk 和 vendor chunk。
      chunks: ['chunk-vendors', 'chunk-common', 'index']
    },
    login: {
      entry: 'src/login.js',
      template: 'public/login.html',
      filename: 'login.html',
      title: '登陸',
      chunks: ['chunk-vendors', 'chunk-common', 'login']
    },
    // 當(dāng)使用只有入口的字符串格式時(shí),
    // 模板會(huì)被推導(dǎo)為 `public/subpage.html`
    // 并且如果找不到的話,就回退到 `public/index.html`。
    // 輸出文件名會(huì)被推導(dǎo)為 `subpage.html`。
    // subpage: 'src/subpage.js'
  },
}

這樣當(dāng)我 window.location.href = '/login'時(shí),匹配到login,靜態(tài)資源就會(huì)返回login.html, 而且 若login頁(yè)面若有多個(gè)路由時(shí),login/route1login/route2也會(huì)正常匹配。

舊城人 回答

推薦官網(wǎng)的寫法。

你們公司的寫法和官網(wǎng)的差別在于。 你公司的寫法無(wú)法catch第一個(gè)參數(shù)的異常。

也就是說(shuō)

 console.log(response);

上面這塊代碼報(bào)錯(cuò),是無(wú)法捕獲的。

陌如玉 回答

router/index.js文件下的path路徑指的是路由路徑,你改為/pages/mine試試

孤慣 回答

哎 同事也遇到了這個(gè)問(wèn)題,最后她把設(shè)置的placeholder去掉了 ie上就好了

安若晴 回答

為啥不這樣,請(qǐng)求父列表的時(shí)候,把子列表的數(shù)據(jù)一同返回,然后點(diǎn)擊時(shí)只做展開(kāi)收起,不調(diào)接口