鍍金池/ 問答
帥到炸 回答

不太清楚,你有新的發(fā)現(xiàn)嗎?

createElement()的調(diào)用方式如下:

React.createElement(
  type,
  [props],
  [...children]
)

綁定事件寫在[props]中,例如:

var target = React.createElement('button', {
  onClick: () => { alert('lol') },
}, 'Click me');

ReactDOM.render(
        target,
        document.getElementById('root')
);

DEMO:
https://codepen.io/CodingMonk...

默念 回答

再給你推薦一個vue的UI庫,element

六扇門 回答

change事件,你input_max 和input_min 都能拿到,不管哪個input輸入值發(fā)生改變時,你都可以進(jìn)行比較,發(fā)現(xiàn)不合法輸入時,進(jìn)行個動作,提示或者清空什么的都可以

茍活 回答

不一定是頁面上,只要沒有引用到就不會計(jì)算

墨沫 回答

當(dāng)你還要模糊的時候,就用redux管理吧。
等你能很好的區(qū)分什么樣的數(shù)據(jù)用redux,什么樣的數(shù)據(jù)用component state時,就可以隨心所欲了。

厭惡我 回答

應(yīng)該是版本問題,4.1.3

笨笨噠 回答
<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <!-- 引入樣式 -->
  <link rel="stylesheet" >
</head>

<body>
  <div id="app">
    <mt-cell-swipe v-for="item in list" :key="item" title="標(biāo)題文字" :label="item" :right="GetBtn(item)">
    </mt-cell-swipe>
  </div>
</body>
<!-- 先引入 Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入組件庫 -->
<script src="https://unpkg.com/mint-ui/lib/index.js"></script>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        list: '123456789'.split('')
      }
    },
    methods: {
      GetBtn(item) {
        return [{
          content: 'Delete',
          style: {
            background: 'red',
            color: '#fff'
          },
          handler: () => this.handleClick(item)
        }]
      },
      handleClick: function (item) {
        this.$toast(item)
      }
    }
  })
</script>

</html>
陪我終 回答

你沒注意看文檔,你那個redirect使用不當(dāng),一般有這么兩種方式:

  • 重定向path
const routes = [
  {
    path:"/HelloWorld",
    component: HelloWorld
  },
  {
    path: "/second",
    component: second
  },
  //默認(rèn)
  {
    path: '/',
    redirect: '/HelloWorld'
  }
]
  • 重定向name
const routes = [
  {
    path:"/HelloWorld",
    name: 'helloworld',
    component: HelloWorld
  },
  {
    path: "/second",
    component: second
  },
  //默認(rèn)
  {
    path: '/',
    redirect: { name: 'helloworld' }
  }
]

參考文檔:https://router.vuejs.org/zh-c...

希望我的回答對你有所幫助!
陌璃 回答

感覺還沒有new array ,然后 indexOf往新數(shù)組push方便

    const a = [1,2,3,4,5], b = [1,2],c = [];
    a.forEach( v => {
      if(b.indexOf(v) === -1) c.push(v)
    })
孤酒 回答

resolve將promise對象當(dāng)前的狀態(tài)變?yōu)槌晒?reject將promise對象當(dāng)前的狀態(tài)變?yōu)槭?,狀態(tài)改變后才會繼續(xù)執(zhí)行then

哎呦喂 回答

3) 字符串比較大小,是按字典序來比較大小的,第一位相同就比較第二位:

console.log('2' > '1') // true
console.log('2' > '12') // true
console.log('a2' > 'a1') // true
console.log('a2' > 'a12') // true
陌離殤 回答

看下this指向哪里,正常來說箭頭函數(shù)里的this是靜態(tài)綁定的,指向了組件實(shí)例對象

愚念 回答

嵌入沒研究過 你可以到這里面去看看這個可不可以做嵌入PDF.js

毀了心 回答

解決了。。。原因是div的寬度不夠,導(dǎo)致的

櫻花霓 回答

我個人認(rèn)為會,ES6 中使用 import 比 require 性能強(qiáng)就是在于,

  1. require:要把這個模塊中的所有內(nèi)容引入
  2. import:可以只把需要使用的引入到文件

所以,按需引入更不耗性能