在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/ HTML問(wèn)答
陌上花 回答

大概這樣吧

axios.com.js //還是要封裝下

import Axios from 'axios'
const Http = (path, method, domain) => {
     return (data, params) => {
        const url = domain + path;
        return Axios({
              method: method,
              url: url,
              data: data,
              params: params,
              }).then((response) => {
              const res = response.data;
              return res;
              }).catch((error) => {
              return error;
              });
    }
}
export function httpGet(path, domain) {
  return Http(path, 'get', domain);
}

api.js

import { httpGet} from './axios.com'; 
export default {
getGoodNew:httpGet('/news','localhost:5000')
}

main.js

import Vue from 'vue';
import Api from './api';
Vue.prototype.$Api = Api;
...
...
this.$Api.getGoodNew(data, params).then(res => {
//...
})
尤禮 回答

iframe中的地址和localhost(本地)服務(wù)不在同一個(gè)域下
iframe中的內(nèi)容不能跨域訪問(wèn)~~~
什么是跨域
外層頁(yè)面(也就是包裹iframe的頁(yè)面)所在的和iframe地址
存在:
訪問(wèn)協(xié)議不同
主域不同
主域相同-子域不同
就存在跨域,瀏覽器將禁止你訪問(wèn)iframe內(nèi)容

當(dāng)然也不是完全不能訪問(wèn),要需要一些手段,自行搜索吧

雅痞 回答
  1. Windowwindow的構(gòu)造函數(shù),不過(guò)不是提供給你使用的。 ,根據(jù) @liqi0816 的提醒,目前能發(fā)現(xiàn)的用法只有instanceof Window。
  2. 所有變量如果沒(méi)有找到,最終都找到window下,window也不例外。(不知道怎么描述,如果不滿足你的問(wèn)題2,那么這時(shí)候window將會(huì)是一個(gè)例外)

    name === window.name;//true
    window === window.window.window;//true
  3. window準(zhǔn)確來(lái)說(shuō)是一個(gè)Web API,僅依賴于運(yùn)行環(huán)境。(不知道怎么描述,只是想說(shuō)Web API,不應(yīng)簡(jiǎn)單的理解為js,比如!!document.all===false

在子組件created的時(shí)候向父組件emit一下 父組件監(jiān)聽(tīng)這個(gè)emit做出對(duì)應(yīng)操作

祈歡 回答

解決了,最后一行多了一行,因?yàn)榘l(fā)現(xiàn)后來(lái)的樣式都出問(wèn)題了,刪掉了最后一行空白行就好了。。。

法克魷 回答

this.data是可以賦值,但并不能渲染到頁(yè)面上,要想渲染到頁(yè)面上必須用this.setData

^匹配字符串的開(kāi)始,匹配一個(gè)位置;
$匹配字符串的結(jié)束,匹配一個(gè)位置;
/^[a-zA-Z0-9]+$/的意思就是首先要匹配字符串開(kāi)始,然后是1到多個(gè)字母或者數(shù)字,然后是字符串的結(jié)束,總結(jié)一下就是整個(gè)字符串就是由1到多個(gè)字母和數(shù)字組成的。

你可以使用字符串的match方法進(jìn)一步查看匹配的情況,test只會(huì)返回true或者false,并不提供匹配的具體的字符串:

let reg1=/[a-zA-Z0-9]+/g;
let reg2=/^[a-zA-Z0-9]+$/g;
 
'13232-3213'.match(reg1) // ["13232", "3213"]
'423432432'.match(reg1) // ["423432432"]

'13232-3213'.match(reg2) // null
'423432432'.match(reg2) // ["423432432"]
朕略萌 回答

這是預(yù)加載的處理,

var imgLoad = function (url, callback) {
        var img = new Image();
         img.src = url; 
       if (img.complete) {
          callback(img.width, img.height);
       }  else {
         img.onload = function () { 
             callback(img.width, img.height);
             img.onload = null; 
          }
        }

壞脾滊 回答
  1. ele-ui的樣式是全局樣式,修改它的樣式不能加scoped。

clipboard.png

clipboard.png
這是它的樣式,這么修改:

clipboard.png

  1. 其實(shí)加important并不好,可能會(huì)影響到其他地方nav組件的樣式,可以在header的前面加一個(gè)class限制一下,比如加個(gè)nav-group,把修改的組件樣式全部放在nav-group里面:

clipboard.png

自己做壓縮,把圖片繪制到制定大小的canvas上,然后調(diào)用wx.canvasToTempFilePath(OBJECT)接口保存為圖片。

wxml

<button bindtap='selectImage'>select image</button>
<button bindtap='saveImage'>save image</button>
<canvas style="width: 300px; height: 200px;" canvas-id="myCanvas"></canvas>

js

// 繪制圖片到canvas上
selectImage:function(){
    const ctx = wx.createCanvasContext('myCanvas')
    
    wx.chooseImage({
      success: function(res){
        ctx.drawImage(res.tempFilePaths[0], 0, 0, 300, 200)
        ctx.draw()
      }
    })
},
//保存圖片
saveImage:function(){
    const ctx = wx.createCanvasContext('myCanvas')
    wx.canvasToTempFilePath({
      x: 0,
      y: 0,
      width: 300,
      height: 200,
      destWidth: 300,
      destHeight: 200,
      canvasId: 'myCanvas',
      success: function(res) {
        console.log(res.tempFilePath)
        wx.previewImage({
            urls: [res.tempFilePath],
        })
      } 
    })
}
逗婦乳 回答

看上去好像是路經(jīng)問(wèn)題 怎么路經(jīng)中出現(xiàn)了index.php,你可以用Chrome看下Elements里面css路經(jīng)對(duì)不對(duì)

遺莣 回答

packake.json.打開(kāi),看script配置,或者看下readme.md有說(shuō)明

別硬撐 回答
minwidth = (minwidth-10) * (8/9) + 10;
maxwidth = maxwidth * (8/9) + 10;

可以拿已知的這個(gè)范圍通過(guò)計(jì)算換算成目標(biāo)范圍啊

祈歡 回答

方案一:自適應(yīng)寬度用百分比
方案二:輪播我只用swiper

情皺 回答
Calling the next() method with an argument will resume the generator function execution, replacing the yield expression where execution was paused with the argument from next().
from: https://developer.mozilla.org...

就是說(shuō),如果你調(diào)用next方法時(shí)附帶了參數(shù)的話,generator會(huì)繼續(xù)執(zhí)行,直到下一個(gè)yield時(shí)停止,這是會(huì)把yield表達(dá)式換成傳入的參數(shù)。

忠妾 回答

你從后端把這個(gè)值渲染到前臺(tái)模板,輸出就可以啦

app.mockSession({
  foo: 'bar'
});
const ctx = app.mockContext();
console.log(ctx.session.foo);

egg-mock#appmocksessiondata

離人歸 回答

1.瀏覽器支持的錨點(diǎn)必須是通過(guò)hash來(lái)實(shí)現(xiàn)的,路由變化對(duì)你的邏輯會(huì)有什么影響嗎?如果有啥影響就處理一下
2.不行的話就不能用錨點(diǎn)的形式,只能自己寫(xiě)個(gè)組件,注冊(cè)點(diǎn)擊事件,然后獲取要滾動(dòng)到的元素的位置,設(shè)置window的scrollTop

尐懶貓 回答
series : [
        {
          data:[
              {
                value:200,
                itemStyle:{
                  normal:{color:'gray'}
              }
              }, 
              {
                value:300,
                itemStyle:{
                  normal:{color:'green'}
              }
              },
              {
                value:1500,
                itemStyle:{
                  normal:{color:'yellow'}
              }
              },
              {
                value:300,
                itemStyle:{
                  normal:{color:'red'}
              }
              }
            ]
        }
    ]