鍍金池/ 問答
怣痛 回答

<form> autocomplete 屬性 了解下

定義和用法
autocomplete 屬性規(guī)定表單是否應(yīng)該啟用自動完成功能。
自動完成允許瀏覽器預(yù)測對字段的輸入。當(dāng)用戶在字段開始鍵入時,瀏覽器基于之前鍵入過的值,應(yīng)該顯示出在字段中填寫的選項。

屬性值
on 默認(rèn)。規(guī)定啟用自動完成功能。
off 規(guī)定禁用自動完成功能。

抱緊我 回答
  • 試了網(wǎng)上幾個方法都不管用,于是我直接簡單粗暴的把 webpack.prod.conf.js 中的 兩處
  • CommonsChunkPlugin注釋掉了。就沒報錯,目前沒問題。
  • 下面把代碼放一下
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')

var env = config.build.env

var webpackConfig = merge(baseWebpackConfig, {
  module: {
    rules: utils.styleLoaders({
      sourceMap: config.build.productionSourceMap,
      extract: true
    })
  },
  devtool: config.build.productionSourceMap ? '#source-map' : false,
  output: {
    path: config.build.assetsRoot,
    filename: utils.assetsPath('js/[name].[chunkhash].js', true),
    chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
  },
  plugins: [
    // http://vuejs.github.io/vue-loader/en/workflow/production.html
    new webpack.DefinePlugin({
      'process.env': env
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      },
      sourceMap: true
    }),
    // extract css into its own file
    new ExtractTextPlugin({
      filename: utils.assetsPath('css/[name].[contenthash].css', true),
      allChunks: true
    }),
    // Compress extracted CSS. We are using this plugin so that possible
    // duplicated CSS from different components can be deduped.
    new OptimizeCSSPlugin({
      cssProcessorOptions: {
        safe: true
      }
    }),
    // generate dist index.html with correct asset hash for caching.
    // you can customize output by editing /index.html
    // see https://github.com/ampedandwired/html-webpack-plugin
    ...utils.getHtmlPlugins(),
    // keep module.id stable when vender modules does not change
    new webpack.HashedModuleIdsPlugin(),
    // split vendor js into its own file
     <1.--------------------------------------------------------------------->
    // new webpack.optimize.CommonsChunkPlugin({
    //   name: 'vendor',
    //   minChunks: function (module, count) {
    //     // any required modules inside node_modules are extracted to vendor
    //     return (
    //       module.resource &&
    //       /\.js$/.test(module.resource) &&
    //       module.resource.indexOf(
    //         path.join(__dirname, '../node_modules')
    //       ) === 0
    //     )
    //   }
    // }),
     ----------------------------------------------------------------------
    // extract webpack runtime and module manifest to its own file in order to
    // prevent vendor hash from being updated whenever app bundle is updated
     <2.--------------------------------------------------------------------->
    // new webpack.optimize.CommonsChunkPlugin({
    //   name: 'manifest',
    //   chunks: ['vendor']
    // }),
     ----------------------------------------------------------------------
    // copy custom static assets
    new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../static'),
        to: config.build.assetsSubDirectory,
        ignore: ['.*']
      }
    ])
  ]
})

if (config.build.productionGzip) {
  var CompressionWebpackPlugin = require('compression-webpack-plugin')

  webpackConfig.plugins.push(
    new CompressionWebpackPlugin({
      asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: new RegExp(
        '\\.(' +
        config.build.productionGzipExtensions.join('|') +
        ')$'
      ),
      threshold: 10240,
      minRatio: 0.8
    })
  )
}

if (config.build.bundleAnalyzerReport) {
  var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
爛人 回答

你controller方法里應(yīng)該下面這個賦值語句是吧?

@products = Product.all

可以改成

@products = Product.order(:id)

讓product按照『id』排個序就行。

北城荒 回答

@歐兜兜是素姀 的回答是正確的,mongoose的Schema可以使用required屬性來規(guī)范數(shù)據(jù),這樣不符合要求的數(shù)據(jù)存入mongodb會失敗的。

但是,就算是數(shù)據(jù)庫規(guī)范了,前端也不能假設(shè)數(shù)據(jù)庫返回的數(shù)據(jù)沒問題,前端還是需要對后端返回的數(shù)據(jù)進(jìn)行驗證和容錯。因為前端和后端是分離的,前端需要假設(shè)后端會出錯。事實上,后端出錯也是無法避免的,因為代碼一直在修改,哪天后端不小心刪掉required字段呢?

舊城人 回答

為何要用正則進(jìn)行匹配替換,如果是整個HTML文檔,那么你可以借用 beautifulsoup 進(jìn)行解析后,批量修改。

涼心人 回答

Java虛擬機(jī)規(guī)范里面并沒有對GC給出任何定義,也不對堆進(jìn)行分類,因此,從理論上來說,是否分年輕代和老年代并不是一定的。

蝶戀花 回答

和遷移沒關(guān)系,你是不是項目沒有.env文件,還是把.env文件里面配置的APP_ENV刪除了

哎呦喂 回答
  1. 打開 HOSTS 文件,添加:

      127.0.0.1 你的api所在的域名
  2. 打開 phpstudy 打開“站點域名管理”,配置一個本地域名,也就是你的api所在的域名
  3. 打開微信開發(fā)者工具,右側(cè)的“詳情”,選擇: 不校驗合法域名、web-view(業(yè)務(wù)域名)、TLS 版本以及 HTTPS 證書
  4. 如果你原來請求的 url 中是 https 的,請暫時先把 改成 http 。

這時,如果你的 php代碼已經(jīng)實現(xiàn)的接口的功能,就應(yīng)該可以正常測試了。

囍槑 回答
可選:'breadthfirst', 'circle', 'concentric', 'cose', 'grid','null', 'preset', 'random'

具體區(qū)別文檔不全建議讀源碼
https://github.com/cytoscape/...

尕筱澄 回答

需要確認(rèn)你的服務(wù)確實運行著

    ps -ef | grep redis
    netstat -antp | grep 6379
    

你的java程序運行在與redis在同一臺機(jī)器上?

嘟尛嘴 回答
SELECT 
    parent_id, catalog_name INTO sParentId,sPathName 
FROM 
    t_knowledge_catalog 
WHERE 
    catalog_id = sChildId;

select 列名1,列名2...列名N into 參數(shù)1,參數(shù)2...參數(shù)N

蝶戀花 回答

換 IP 已經(jīng)超出 selenium 的范圍,常見的手法如重新?lián)芴枴⒏鼡Q代理服務(wù)器等等。

浪婳 回答

把line-height設(shè)為39px
根據(jù)border-box模型,40px的height,1px的border-bottom,content-box的高度就為39px
你給他一個40px的line-height的文字就把content-box撐大了1px

裸橙 回答

字符串比較了解一下,strcmp();
你直接打印一下 echo myfunction('Dog'),結(jié)果輸出也是'Fido'

九年囚 回答

intersect函數(shù)的作用是"找出交集", 交集的元素是在每個集合都出現(xiàn)的元素, 如果元素a在集合A1中不存在, 那么它就肯定不在交集中, 沒必要去檢查剩下的集合A2, A3... 所以第一輪以1去檢查[2, 8, 16, 32, 64, 128], 發(fā)現(xiàn) 1 not in a[1] 那么不需要去檢查 a[2]了, 就break, 接著用2去檢查.

喜歡你 回答

下載好字體資源
app.css加入

@font-face {font-family: "anticon";
  src: url('./static/fonts/iconfont.eot'); /* IE9*/
  src: url('./static/fonts/iconfont.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */
  url('./static/fonts/iconfont.woff') format('woff'), /* chrome, firefox */
  url('./static/fonts/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
  url('./static/fonts/iconfont.svg#anticon') format('svg'); /* iOS 4.1- */
}

.anticon {
  font-family:"anticon" !important;
  font-size:16px;
  font-style:normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}

路徑根據(jù)你自己的路徑替換一下就可以了

這樣的話,可以直接reduce people對象數(shù)組,根據(jù)list中的name獲取相應(yīng)username,然后把list直接指向reduce生成的新username list
額 獻(xiàn)丑一下,因為最新剛學(xué)了reduce

let userNames = []
people.reduce((accumulator, currentValue) => {
    if (list.indexOf(currentValue.name) !== -1) {
        accumulator.push(currentValue.username)
    }
    return accumulator
  }, userNames
)
list = userNames
淺淺 回答

你爬這個網(wǎng)站怎么實現(xiàn)翻頁的繼續(xù)爬的?

吢涼 回答

具體是什么情況呢 題主能不能show代碼??