鍍金池/ 問答/ HTML問答
尕筱澄 回答
<el-table-column fixed label="國內(nèi)階段" width="200">
    <template slot-scope="scope">
        <span v-html="scope.row.course"></span>
    </template>
</el-table-column>
<el-table-column label="科目Module" width="546">
    <template slot-scope="scope">
        <span v-html="scope.row.obj"></span>
    </template>
</el-table-column>
夢若殤 回答

JS代碼:

//鼠標事件:1.播放音樂 2.更改背景色
function mouseEvent_changeColor() {
    var tabs = document.getElementsByTagName("th");
    var tabsLen = tabs.length;
    for(var i=0;i<tabsLen;++i) {
        var curColor;
        tabs[i].onmouseover = function() {
            //更改背景色
            curColor = this.style.backgroundColor;
            this.style.backgroundColor = "#fff";
            //播放音樂
            playMusic(this.id);
        }
        tabs[i].onmouseout = function() {
            //改回原本的背景色
            this.style.backgroundColor = curColor;
        }
    }
    
}

function playMusic(thisId){
    var audio = document.getElementById("music");
    audio.src = "songs" + "/" + thisId + ".mp3";
    console.log(thisId + " " + audio.src);
    audio.play();
}

HTML代碼:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Color and Music</title>
        <link rel="stylesheet" href="colorAndMusic.css">
    </head>
    <body>
        <table id="colorTable">
        <tr>
            <th class="_ffffcc" id="d5"> </th>
            <th class="_ffcccc" id="d3"> </th>
            <th class="_8696a7" id="d3"> </th>
            <th class="_fffaf4" id="d4"> </th>
            <th class="_cc9999" id="d2"> </th>
            <th class="_e3b4b8" id="d2"> </th>
            <th class="_eea2a4" id="d1"> </th>
            <th class="_8fb2b9" id="d3"> </th>
        </tr>
        </table>
        <audio src="" id="music"></audio>
        <script src="colorAndMusic.js"></script>
    </body>
</html>

除了修改代碼之外,發(fā)現(xiàn)ogg格式播放有問題。雖然chrome支持ogg,但只要更換成MP3格式就能正常播放。

萌小萌 回答
npm run build之后用自己寫的server.js打不開

這是什么意思,從代碼上看server.js是運行在服務(wù)端的一個靜態(tài)資源服務(wù),那么為什么要打包到dist,又不能在瀏覽器端運行,是我理解錯問題了嗎。

小曖昧 回答
  1. 父組件異步fetch到值然后setState
  2. 或者使用dispatch, 然后子組件中通過mapStateToProps得到請求值
陪她鬧 回答

從 vue-loader 9.x 開始,父組件的 scoped 樣式會作用在 slot 里的內(nèi)容上。詳情見 https://github.com/vuejs/vue-...。翻了下文檔好像的確沒有提起這件事,你可以在那個 issue 下面評論建議他們把這條加到文檔里去

吃藕丑 回答

你定時器里面的函數(shù)執(zhí)行已經(jīng)超出了promise塊的控制,你只有調(diào)用resolve或reject才能讓它重新控制

初心 回答

fun方法返回了一個對象 對象的fun屬性又是這個fun方法 所以不論調(diào)誰的fun方法 都返回一個對象 可以對輸入的參數(shù)做記憶

空痕 回答

我只對javascript熟悉,其他做不出解答。
但是在JS中,數(shù)字類型只有number類型,不分 int float double等,統(tǒng)統(tǒng)都是number。

念舊 回答

報錯信息不是提示你了嗎,server/views路徑下找不到error這個文件,express需要在app.js里設(shè)置view的路徑和模板引擎:

app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

對應(yīng)的views文件夾下應(yīng)該有個error.jade。

清夢 回答

:key 指定錯了應(yīng)該會導(dǎo)致此異常 ?

  • 例如

 <div   v-for="(value,index) in starUnits" :key="index">
       <p class="personne">{{value}}</p>
        <div v-if="value.boolean"></div>
 </div>

不應(yīng)該 :key="index" 應(yīng)該寫 :key="value" 因為下文有<p class="personne">{{value.title}}</p>的一些引用。

你用的是1.0嗎?2.0應(yīng)該報錯信息更加豐富

有點壞 回答

<router-view/>?什么東西,,去掉試一下。

自己去看簡書一篇文章,思路是自己維護一個狀態(tài),再用setInterval()函數(shù)根據(jù)時間間隔觸發(fā)按鍵,變相達到同時按下的效果。
我只是搬運工~
http://www.jianshu.com/p/9b6d...

不將就 回答
  1. 使用ssh 進入系統(tǒng)

  2. 按裝readme.md編寫server.js

  3. 使用用npm install 安裝相關(guān)包

  4. 然后使用pm2 來啟動

具體還是見文檔

誮惜顏 回答

你動畫設(shè)置order為4,因為你在元素上已經(jīng)設(shè)置了粉div為4了,而且DOM元素的結(jié)構(gòu)粉div在最后,當order相同時,寫在前面的div會更靠前,因而綠色div不會運動到粉色div后面

失魂人 回答

@fuqihan 大佬,問什么我卸載最新的vue-cli然后安裝指定版本就會報這樣的錯誤!
我重新安裝了好幾遍,2.5.0和2.8.1,2.8.2都試了,全部都是這樣,請指教,謝謝謝

圖片描述

玄鳥 回答

listener 里的 function 的 this 不對吧, 指向的應(yīng)該不是 vue 的 this, 換成() => 應(yīng)該就好了.

<script>
export default {
    data: () => ({
      isShowCover: false
    }),
    mounted() {
    let self = this; // 這里
    window.addEventListener(
      "onorientationchange" in window ? "orientationchange" : "resize",
      function() {
        if (window.orientation === 90 || window.orientation === -90) {
            //想把下面的alert換成能夠控制v-show的代碼
            
          alert(
            self.$options.methods.showCover() +
              "橫屏可能導(dǎo)致頁面異常,建議豎屏操作!"
          ); // 這里用 this 作用域就不對了.
          //alert("123");僅alert純文本可以正常運行
        }
        //window.location.reload();
      },
      false
      );
    },
    methods:{
        showCover() {
          return "123";
        },
    }
</script>