computed方法會(huì)在頁(yè)面初始化的時(shí)候執(zhí)行一次,第一次應(yīng)該是被return掉才執(zhí)行setinterval,然后是函數(shù)內(nèi)部中使用的data中的屬性發(fā)生變化的時(shí)候才會(huì)執(zhí)行,你點(diǎn)擊的事件并沒(méi)有改變time_60 這個(gè)值,所以count_down并沒(méi)有執(zhí)行,刷新后應(yīng)為cook中有值,沒(méi)有被return 才會(huì)運(yùn)行setinterval;1樓說(shuō)的對(duì),這樣的邏輯不適合寫(xiě)在計(jì)算屬性中,應(yīng)該定義在methods中,在掉接口的回調(diào)中運(yùn)行比較合適。
還有個(gè)問(wèn)題count_down中沒(méi)有return 任何有效值,看你的邏輯,應(yīng)該只會(huì)展示undefined和null.
That's easy. 我給你翻譯下這段歌詞:
defmodule Chop do
def guess(actual, range = low..high) do
guess = div(low+high, 2)
IO.puts "Is it #{guess}?"
_guess(actual, guess, range)
end
defp _guess(actual, guess, low..high) do
cond do
guess == actual -> IO.puts "Yes, it's #{actual}"
guess < actual -> guess(actual, guess+1..high)
guess > actual -> guess(actual, low..guess-1)
end
end
end
Chop.guess(271, 1..1000)
這個(gè)程式在邏輯上是等價(jià)的, 雖然一個(gè)是條件語(yǔ)句
, 一個(gè)是pattern matching
.
其實(shí)
defp _guess(actual, actual, _),
do: IO.puts "Yes, it's #{actual}"
defp _guess(actual, guess, _low..high)
when guess < actual,
do: guess(actual, guess+1..high)
defp _guess(actual, guess, low.._high)
when guess > actual,
do: guess(actual, low..guess-1)
它就是一個(gè)pattern matching
, 只是你需要意識(shí)到把guess > actual
, guess > actual
, 以及其它任意情況(在這裏就只剩下相等啦)是作爲(wèi)match的條件而存在的.
你也可以自己改寫(xiě)成另一種pattern matching
, 即case guess do
形式, 這兩者是完全等價(jià)的, 只是看自己的品味, 窩寫(xiě)standard ml的時(shí)候更喜歡case
哈.
可能你對(duì)pattern matching
還不熟悉, 多寫(xiě)寫(xiě)就行啦, elixir的精華之一是pattern matching
, 你以後可以儘可能的用patter matching
, 有些時(shí)候會(huì)比較燒腦, 比起定義本地變量(典型的如sml中的let in
)也可能會(huì)效率低些(因爲(wèi)很多情況會(huì)以無(wú)法使用尾遞歸爲(wèi)代價(jià)), 但是會(huì)非常簡(jiǎn)潔, 非常具有美感, 好好發(fā)現(xiàn)elixir的美吧, 掃年, functional programming的大門(mén)在等著你打開(kāi)
去挑router.js里面自定義路由字段就好了
在網(wǎng)上查找了一番,發(fā)現(xiàn)一個(gè)Speak.js
的js插件能實(shí)現(xiàn)將內(nèi)容識(shí)別成語(yǔ)音并播放出來(lái),鏈接為:http://www.5imoban.net/jiaoch...
由于沒(méi)有具體使用過(guò),只能在此給你一些在vue
中使用第三方插件的一些建議:
1、將第三方文件放到static
目錄下的文件中,例如放在/static/js
中
2、在main.js
中引入(需要此插件支持import語(yǔ)法
),import test from "/static/js/xxx.js"
3、注冊(cè)到vue原型
上:Vue.prototype.$speak = test
(這里的$speak
可以自己取名)
4、在使用時(shí)通過(guò)this.$speak
就可以拿到注冊(cè)到vue原型上的插件了
具體用法類似與我寫(xiě)過(guò)的一篇文章: Vue中配合clipboard.js實(shí)現(xiàn)點(diǎn)擊按鈕復(fù)制內(nèi)容到剪切板
希望我的回答對(duì)你有所幫助!
UploadController負(fù)責(zé)后端接收?qǐng)D片文件并保存到項(xiàng)目的images路徑下
關(guān)鍵是僅僅存儲(chǔ)就可以了是吧?存儲(chǔ)完后要干啥么(比如做為資源給用戶訪問(wèn)?)?如果僅僅是存儲(chǔ),找個(gè)服務(wù)器的目錄存儲(chǔ)就行了吧
永遠(yuǎn)無(wú)法執(zhí)行到的代碼就會(huì)這樣顯示
const test = () => {
const a = 1;
return 2;
console.log(11); //這一行也會(huì)出現(xiàn)你這種情況,因?yàn)樗肋h(yuǎn)無(wú)法執(zhí)行
}
我也遇到這個(gè)問(wèn)題了,現(xiàn)在解決了,但是我忘了我怎么操作的,你可以試試把項(xiàng)目設(shè)置里面的“不校驗(yàn)安全域名.....”勾上,看看還會(huì)不會(huì)報(bào)錯(cuò)?等我想起來(lái)再來(lái)回答你,?
你對(duì)圖片路徑做了說(shuō)明處理么?
在Linechart.js寫(xiě)props
props: {
Data: {
type: Array,
default: []
},
}
在example.vue傳數(shù)據(jù)過(guò)去
<line-chart
:width="370"
:height="246"
:Data="data">
</line-chart>
這樣Linechart.js就能拿到數(shù)組
根據(jù)《Effect Java》第二版總結(jié):
異常分為:
運(yùn)行時(shí)異常和錯(cuò)誤都是不需要也不應(yīng)該被捕獲的可拋出結(jié)構(gòu)。如果程序拋出運(yùn)行時(shí)異?;蛘咤e(cuò)誤,說(shuō)明出現(xiàn)了不可恢復(fù)的情形,繼續(xù)執(zhí)行下去有害無(wú)益。如果沒(méi)有捕捉到這樣的結(jié)構(gòu),將會(huì)導(dǎo)致當(dāng)前線程停止,并出現(xiàn)適當(dāng)?shù)腻e(cuò)誤消息。
使用原則:
首先給你點(diǎn)個(gè)贊,8.0發(fā)布后還真沒(méi)注意到有這個(gè)新特性,剛?cè)ysql官網(wǎng)查了下,如下:
The .frm metadata files previously associated with base tables and views no longer exist. Metadata previously stored in .frm files is now stored in data dictionary tables.Similarly, trigger metadata previously stored in .TRG and .TRN files is stored in a data dictionary table and those files no longer exist.
大概就是說(shuō).frm元數(shù)據(jù)文件已經(jīng)不存在了,現(xiàn)在被存儲(chǔ)在數(shù)據(jù)字典表中了。至于數(shù)據(jù)字典在哪,沒(méi)細(xì)看,應(yīng)該是在information_schema庫(kù)中,對(duì)比下表改動(dòng)還是很大的。
上面還給出一個(gè)信息.TRG觸發(fā)器文件也不存在了。
傳送門(mén)
感覺(jué)像是node版本問(wèn)題,前幾天我剛用yarn裝過(guò)@vue/cli
另外yarn我設(shè)置了阿里的鏡像源。
我的版本信息如下:
希望能對(duì)你有所幫助。
vue create 創(chuàng)建項(xiàng)目時(shí)如果選擇了SASS 需要安裝python 2.x 版本。
不止0到99 實(shí)際是00 到FF 也是16進(jìn)制
bindscrolltoupper 這個(gè)能滿足嗎 也是 scroll-view 中的方法
注解本質(zhì)上就是一個(gè)接口,它的實(shí)質(zhì)定義為: interface SomeAnnotation extends Annotation。
這個(gè) Annotation 接口位于 java/lang/annotation 包,它的注釋中第一句話就是 The common interface extended by all annotation types.
-- 通過(guò)反射,動(dòng)態(tài)修改注解的某個(gè)屬性值
沒(méi)有驗(yàn)證過(guò),但是我個(gè)人理解是 用session 的話,如果登陸信息放緩存,那么重啟肯定沒(méi)了,如果放數(shù)據(jù)庫(kù)那還有。
用token的話,只要時(shí)間不過(guò)期,登陸狀態(tài)應(yīng)該不會(huì)消失。
class PrivateRoute extends React.Component {
render(){
const { component: Component, ...rest } = this.props
return (
<Route
{...rest}
render={props =>
fakeAuth.isAuthenticated ? (
<Component {...props} />
) : (
<Redirect
to={{
pathname: "/login",
state: { from: props.location }
}}
/>
)
}
/>)
}
}
路由重定向
react-router 路由寫(xiě)法 (先導(dǎo)入基本的組件)
<HashRouter>
<Switch>
<Route path="/index" component={home} />
<Route path="/record" component={record} />
<Redirect from="/" to="/index" />
</Switch>
</HashRouter>
vue-router 寫(xiě)法
{
path: '/',
redirect: '/index',
},
{
path: '/index',
name: 'index',
component: home,
}
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。