鍍金池/ 問答
舊螢火 回答

已經(jīng)解決,在app.module.ts的imports里面刪除進(jìn)行懶加載的模塊

// 懶加載
{
  path: 'set',
  loadChildren: 'app/setting/setting.module#SettingModule'
},
// app.module.ts
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    FormsModule,
    // 非懶加載模塊
    PopupModule,
    CoreModule,
    PipeModule,
    RoutesModule,
    CashRegisterModule,
    // 懶加載模塊
    // SettingModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

同時(shí),在setting.route.module.ts里面path寫空:

// setting.route.module.t
@NgModule({
  imports:
    [
      RouterModule.forChild([
        {
          // path: 'set',
          path: '',
          component: SettingComponent
        }
      ])
    ],

  exports:
    [
      RouterModule
    ],

  providers:
    []
})
export class SettingRouteModule
{
}

原來的寫法其實(shí)并沒有實(shí)現(xiàn)懶加載,但是angular4不是出錯(cuò),但是在angular5就會(huì)提示懶加載的錯(cuò)誤

放開她 回答
  1. 事件回調(diào)函數(shù)的this指向觸發(fā)事件的DOM節(jié)點(diǎn);
  2. 普通函數(shù)的this與調(diào)用方式有關(guān),一共有四種;
  3. fun()屬于普通函數(shù)調(diào)用,this指向window。
深記你 回答

問題解決了,iframe設(shè)置允許就可以了

To continue to use permissions from iframes on your website...
This deprecation is expected to ship in Chrome M64 (around January 2018). At that time, if a cross-origin iframe attempts to use permission without the feature being explicitly allowed, a console warning will be logged and the feature will fail in a similar way as it would if a user had denied a permission prompt.

If you are a developer of a website which uses cross-origin iframes and you want those iframes to continue to be able to request/use one of the above features, the page that embeds the iframe will need to be changed. The simplest way to do that is to modify the <iframe> tag to include an allow attribute which specifies the name of the permission. For example, to enable geolocation and mic/camera for an iframe, the following would be specified:

<iframe src="https://example.com" allow="geolocation; microphone; camera"></iframe>

Valid values for allow include:
geolocation
microphone
camera
midi
encrypted-media
Note that if the iframe which is using the permission has the same origin as the top level page, then no changes have to be made.

參考:https://sites.google.com/a/ch...

亮瞎她 回答

你這個(gè)描述無法確認(rèn)問題.

登陸后返回到登陸頁面 你這個(gè)數(shù)據(jù)是如何獲取到的? 還有你登陸時(shí)候你調(diào)試一下 文本框是否有值 等等

如果頁面顯示對應(yīng)的手機(jī)還有密碼 但是登陸不成功 可能存在請求與數(shù)據(jù)存取先后的問題
別傷我 回答

1、Form 組件的getFieldDecorator高階方法中,第二階中只能是一個(gè)組件。不要出現(xiàn)div之類的組件。
2、提問問題的時(shí)候,不要將代碼以圖片的形式貼出來。該編輯器支持program code.

舊言 回答

這個(gè)最好不要注冊成組件或指令, 使用自定義插件然后注冊實(shí)例方法

Vue.prototype.$alert = {
  open: () => console.log('打開'), 
  close: () => console.log('關(guān)閉')
};

這樣可以讓別人在他的組件內(nèi)部直接調(diào)用你的api

this.$alert.open();

插件只需要在 main.js 引入, 類似 vue-router

囍槑 回答
var pt = new BMap.Point(116.40387397, 39.91488908);
geoc.getLocation(pt, function(rs){
    console.log(rs)
}); 
骨殘心 回答

你看這樣行不行,我是行的,addEvent 不行


window.onbeforeunload=function(){
      return 'Your own message goes here...';
}
陌南塵 回答

props傳遞,這也是大部分UI組件使用的方式。你這已經(jīng)是父子組件了當(dāng)然是采用props down, events up
如無必要盡量少的直接操作dom,因?yàn)関ue的思想數(shù)據(jù)驅(qū)動(dòng)視圖,而不是直接操作.
當(dāng)然一些場景下還是有必要使用$refs的,比如獲取一個(gè)元素的寬高..

厭遇 回答

http://flask.pocoo.org/docs/0...

Flask中有一個(gè)全局變量g,你可以將你的參數(shù)添加到其中:

g.your_var = 'something'

然后在任意視圖導(dǎo)入并使用即可。

from flask import g

def view_func():
  val = g.your_var
  ...
尐潴豬 回答

自定義校驗(yàn)規(guī)則

function valid(rule, value, callback) {
    if (!requiredRemark) {
        // 備注為非必填
        callback();

    } else if (value === '') {
        // 備注必填且為空
        callback(new Error('請輸入備注'));

    } else {
        // 備注必填且通過
        callback();
    }
};
苦妄 回答

你的contract_template_select下面的div有沒有定位,沒有的話加上定位,哪怕是用position:relative;z-index:999;都行

柚稚 回答
Even on platforms where native scrolling is good enough, iScroll adds
features that wouldn't be possible otherwise. Specifically:

Granular control over the scroll position, even during momentum. You
can always get and set the x,y coordinates of the scroller. Animation
can be customized with user defined easing functions (bounce, elastic,
back, ...). You can easily hook to a plethora of custom events
(onBeforeScrollStart, onScrollStart, onScroll, onScrollEnd, flick,
...). Out of the box multi-platform support. From older Android
devices to the latest iPhone, from Chrome to Internet Explorer.

簡單說就是,iscroll具有:

  1. 細(xì)粒度控制,可以實(shí)時(shí)獲取x,y坐標(biāo)。
  2. 可以定制多種動(dòng)畫模型
  3. 有許多好用的鉤子,例如onScrollStart...
  4. 跨平臺性。

此外,iscroll會(huì)根據(jù)設(shè)備和瀏覽器的不同,選擇性能最佳的方式進(jìn)行模擬滾動(dòng)。

愿如初 回答

圖片描述

這個(gè)URL是什么,看起來略高端。

薔薇花 回答

你的myChart是局部變量
因?yàn)槟闶钦{(diào)兩次所以用全局接受不好分別兩個(gè)可以把,mychart返回出去
然后 var charts1 =getchart('a')

舊城人 回答

https://jsfiddle.net/3m8fhc01/
雖然是可以這樣做,不過目前瀏覽器支持不佳

更新

我用的是radial-gradient,瀏覽器支持不算好,不過我看到答案里有用linear-gradientbox-shadow的,這兩個(gè)的瀏覽器支持還算可以,不過凹進(jìn)去的區(qū)域并不是透明的,就看有沒有這個(gè)需要

夏木 回答

把不常改動(dòng)的第三方依賴拿出來單獨(dú)打包(例如用DllPlugin),然后把文件添加到webpack項(xiàng)目的如static一類的文件夾,并編寫相關(guān)配置,最后在html模板上直接用script標(biāo)簽引入即可

夏木 回答

python里面import是有路徑的,你可以查下相關(guān)資料,這里我簡單說明下其中的一種:

當(dāng)我有/home/a/main.py/home/b/utils.py文件時(shí),此時(shí)我使用python /home/a/main.py運(yùn)行該文件時(shí),python會(huì)自動(dòng)將/home/a/目錄加到import的搜索路徑里面,如果/home/a/main.py文件里面需要引用/home/b/utils.py里面的文件直接使用from b import utils是不行的,因?yàn)?code>/home/b/沒有在python的import路徑里面。

解決辦法有幾種:
1,使用sys.path.append('你的包路徑,對應(yīng)你的項(xiàng)目應(yīng)該是coupon_content的父級,假如說coupon_content目錄是在/home/dir/目錄下,那這里就是/home/dir');
2,使用相對路徑引用;