鍍金池/ 問(wèn)答
我以為 回答

確實(shí),按照正常情況來(lái)講的,當(dāng)this為object時(shí),this.message是絕對(duì)不會(huì)報(bào)錯(cuò)的。

然鵝js不會(huì)欺騙你,那么這個(gè)鍋只能讓vue來(lái)背了。

你可以點(diǎn)擊控制臺(tái)報(bào)錯(cuò)的這一行,查看拋出錯(cuò)誤的vue代碼,也就是vue.esm.js?a026:3297:
at VueComponent.proxyGetter [as trigger] (vue.esm.js?a026:3297)

然后你會(huì)發(fā)現(xiàn),代碼大概是這樣的:

var sharedPropertyDefinition = {
  enumerable: true,
  configurable: true,
  get: noop,
  set: noop
};

function proxy (target, sourceKey, key) {
  sharedPropertyDefinition.get = function proxyGetter () {
    return this[sourceKey][key] // 是這里報(bào)錯(cuò)了 sourceKey為_(kāi)props, key為message
  };
  sharedPropertyDefinition.set = function proxySetter (val) {
    this[sourceKey][key] = val;
  };
  Object.defineProperty(target, key, sharedPropertyDefinition);
}

重點(diǎn)在于return this[sourceKey][key]。

實(shí)際上this.message調(diào)用的并不是vue實(shí)例對(duì)象下的message屬性,而是this._props.message。
this._props在此時(shí)(beforeCreate)是undefined的。
這跟vue的生命周期有關(guān),可以看這個(gè)圖:https://cn.vuejs.org/images/l...。

And,如果你在created鉤子中console.log(this),你會(huì)發(fā)現(xiàn)this下是會(huì)有message屬性的...(也有_props.message)。

是因?yàn)樯厦尜N出的代碼中有這一段:Object.defineProperty(target, key, sharedPropertyDefinition);
target是當(dāng)前vue實(shí)例,key是message這一類(lèi)的props。
( vue用了definePropertythis.message指向了this._props.message。)

所以,我們還可以做一個(gè)試驗(yàn):

  created() {
    console.log(this._props) // object
    console.log(this.message, 11)  // 'message content'
    delete this._props.message
    console.log(this.message, 22) // undefined
  }
任她鬧 回答

不一定非要在main.js里抓取每一次的router變動(dòng),只要在login頁(yè)面做處理就可以解決問(wèn)題。
在login頁(yè)里添加:

methods: {},
beforeRouteEnter (to, from, next) {
    if (!getToken()) { // 這里檢查是否獲取到cookie
       next()
    } else {
       next({
           path:"/" 
       })
    }
}
維她命 回答

js去構(gòu)造后端需要的數(shù)組,foreach你下拉列表中拿到的[2,3](舉個(gè)例子),每次將{appId:foreachItem,direction:1}放到一個(gè)數(shù)組變量里,最后將這個(gè)數(shù)組傳遞給后端

悶騷型 回答

用docker容器啟數(shù)據(jù)庫(kù)服務(wù)的話,需要將數(shù)據(jù)庫(kù)的數(shù)據(jù)掛載到宿主機(jī)上,否則每次重啟容器都會(huì)導(dǎo)致數(shù)據(jù)丟失。
可以使用-v參數(shù)將mysql的數(shù)據(jù)目錄/var/lib/mysql掛載到宿主機(jī)的某個(gè)目錄下,就可以持久化數(shù)據(jù)。

乖乖噠 回答

這東西能力還有待提升,我之前一個(gè)項(xiàng)目用這個(gè),在安卓上就沒(méi)毛病 IOS上就有的樣式錯(cuò)亂

你好胸 回答

前端

axios.post('/post',{data:表1數(shù)據(jù),data2:表2數(shù)據(jù)});

后端(KOA為例,需要koa-bodyparser中間件)

const {data,data2} = ctx.request.body;
const [model,model2] = await Promise.all([Model.create(data),Model2.create(data2)]);
骨殘心 回答

C++來(lái)湊個(gè)熱鬧。

#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>

template <class It>
std::vector<std::vector<int>> Solution(It first, It last) {
  std::vector<std::vector<int>> result;
  while (first != last) {
    auto ite = std::adjacent_find(first, last, [](int l, int r) {return l != r-1;});
    if (ite != last)
      ++ite;
    if (std::distance(first, ite) > 1)
      result.emplace_back(first, ite);
    first = ite;
  }
  return result;
}

int main() {
  std::vector<int> vtr = {1, 2, 3, 5, 1, 2, 1};

  for (const auto &result : Solution(vtr.begin(), vtr.end())) {
    std::copy(result.begin(), result.end(), std::ostream_iterator<int>(std::cout, " "));
    std::cout << std::endl;
  }

  return 0;
}
胭脂淚 回答

<li *ngFor="let message of mailService.messages; index as i;"> {{i}} - {{message}} </li>

嫑吢丕 回答

1.首先瀏覽器是請(qǐng)求http://localhost:8080/abc/signup/video沒(méi)錯(cuò)的,發(fā)出去的請(qǐng)求被dev-server收到,然后轉(zhuǎn)發(fā)到目標(biāo)地址,相當(dāng)于代理
2.不生效是你的配置不對(duì),你主要配置最終請(qǐng)求地址應(yīng)該是http://122.79.10.259:8080/signup/video

代碼確實(shí)有點(diǎn)問(wèn)題,我寫(xiě)了一個(gè)

const temp = {};
for (item in dateInfo) {
    const val = dateInfo[item]
    const str1 = item.match(/(\S*)_/)[1];
    if (!temp[str1]) {
        temp[str1] = {};
        temp[str1][item] = val;
    } else {
        temp[str1][item] = val
    }
}

const new_arr = Object.values(temp);

console.log(new_arr);
情已空 回答

AJAX獲取COOKIE的話是要后端設(shè)置cookie并返回的

萌二代 回答

我這里出現(xiàn)了一個(gè)錯(cuò)誤就是,在使用 php 執(zhí)行這個(gè)定時(shí)文件的過(guò)程中,會(huì)報(bào)錯(cuò)。使用curl就沒(méi)問(wèn)題了。即在安裝postfix的情況下,修改定時(shí)文件的內(nèi)容為
*/1 * * * * curl http://localhost/ds.php
即可

乖乖噠 回答

測(cè)試下了你的DEMO,你的TOP計(jì)算有點(diǎn)問(wèn)題
你吧所有圖片 換一張等比例的圖片,你就知道問(wèn)題了

根據(jù)自己的理解回復(fù)(不對(duì)的地方請(qǐng)大家指出來(lái),一起學(xué)習(xí)):

1.xdebug.remote_host 表示綁定客戶(hù)端 host,默認(rèn)為 localhost
2.PHPStorm 設(shè)置里面的 server 表示要監(jiān)聽(tīng)的服務(wù),host 為要監(jiān)聽(tīng)的主機(jī)地址,本機(jī)填寫(xiě) localhost 就可以
3.DBGp Proxy 代理配置,不用管
4.xdebug helper 非必要,laradock 環(huán)境下不用安裝也可以進(jìn)行 Xdebug 斷點(diǎn)調(diào)試

可以參考一下:https://segmentfault.com/a/11...

涼薄 回答

'@\components\new_medication_history\drug_arrangement.vue'

試試這個(gè)


貌似你這個(gè)報(bào)錯(cuò)不是因?yàn)榻M件引用錯(cuò)誤吧

下面不是說(shuō)你缺 vue-style-loader ...什么的嗎

大濕胸 回答

你試一下給子路由添加name屬性,然后跳轉(zhuǎn)那里直接:to={name: 'xxxx'}這樣試一下