decodeURIComponent轉(zhuǎn)一下
為啥要用span去包img?
要實現(xiàn)垂直居中又很多方法,個人推薦用flex布局,類似這樣:
//html
<div>
<img/>
<img/>
</div>
//css
div{
display:flex;
align-item:center
}
div>img{
//自定義高度與寬度
}
如果要學flex布局,推薦阮一峰的。
1 需要天氣api接口 請百度
2 需要根據(jù)天氣數(shù)據(jù)寫樣式
3 完成
因為 if(this.width==290){你只在第一次的時候檢測了,后來的 interval 里沒有去檢測,所以失敗。
//子組件
<template>
<div><canvas width="400" height="400" ref="drawing"></canvas></div>
</template>
<script>
var interval;//new added
export default {
mounted(){
interval=setInterval(this.drawing,200);
},
name: "canvas-animation",
data(){
return {width:100}
},
methods:{
drawing() {
var context=this.$refs.drawing.getContext("2d");
context.fillStyle="#409eff";
context.fillRect(10,10,this.width,this.width);
this.width=this.width+10;
if(this.width==290){
console.log("over");
clearInterval(interval);
}
}
}
}
</script>
<style scoped>
</style>不要緩存html文件
為什么我的寫了,還是這樣子
ERROR in ./node_modules/_cube-ui@1.9.2@cube-ui/src/common/helpers/instantiate-component.js
Module parse failed: Unexpected token (10:4)
You may need an appropriate loader to handle this file type.
|
| const instance = new Vue({
| ...options,
| render(createElement) {
| let children = childrenRenderFn && childrenRenderFn(createElement)
@ ./node_modules/_cube-ui@1.9.2@cube-ui/src/common/helpers/create-api-component.js 1:0-58
@ ./node_modules/_cube-ui@1.9.2@cube-ui/src/common/helpers/create-api.js
@ ./node_modules/_cube-ui@1.9.2@cube-ui/src/modules/create-api/index.js
@ ./node_modules/_cube-ui@1.9.2@cube-ui/src/module.js
@ ./node_modules/_cube-ui@1.9.2@cube-ui/src/index.js
@ ./src/main.js
用for循環(huán),找到之后直接return這個符合條件的這個node節(jié)點
for(var i=0;i<node;i++){
if(node.children[i].getAttribute('id') === '1234'){ //getAttribute() 方法返回指定屬性名的屬性值
return node.children[i];
}
}
如果你想深層次遍歷的話,推薦你看看這篇:DOM遍歷節(jié)點以及屬性
利用三角形就可以了!
.bubble {
position: relative;
padding: 8px 16px;
background: #f7f7f7;
border: 1px solid #ccc;
}
.bubble:before {
content: '';
position: absolute;
display: block;
bottom : -10.5px;
right: 0;
width: 0;
height: 0;
border-top: 12px solid #f7f7f7;
border-left: 12px solid transparent;
z-index: 10;
}
.bubble:after {
content: '';
position: absolute;
display: block;
bottom : -13px;
right: -1px;
width: 0;
height: 0;
border-top: 13px solid #ccc;
border-left: 13px solid transparent;
}export default {
data () {
return {
tag: '1',
commonList:
[
{
id:1,
name:"西瓜"
},
{
id:2,
name:"蘋果"
}
],
}
},
<checklist title="請選擇" :options="tag === item.id" v-model="fruitID" v-for="item in commonList"></checklist>
樓上正解,視情況而定,看你想什么時候得到數(shù)據(jù),
單詞寫錯了
這是我之前做的一個demo,導入的3d模型文件是obj格式的,需要使用OBJLoader和MTLLoader,
mtl文件用于描述多邊形可視面貌的材質(zhì)
如果你可以導出obj、mtl文件的話,那么就可以使用下面的代碼把3d模型添加到three.js構(gòu)建的場景里了
function loadBuild() {
var loader = new THREE.OBJLoader();
var mtlLoader = new THREE.MTLLoader();
mtlLoader.setPath( "city/" );
mtlLoader.load('house.mtl', (mtl) => {
mtl.preload();
loader.setMaterials(mtl);
loader.setPath("city/");
// load a resource
loader.load(
// resource URL
'house.obj',
function ( object ) {
const renderingParent = new THREE.Group();
renderingParent.scale.set(0.3, 0.3, 0.3);
renderingParent.add(object);
scene.add( renderingParent );
}
);
});
}
也可以參考這個的源碼view-source:https://threejs.org/examples/webgl_loader_obj.html
打開 build/dev-server.js 注釋這行 app.use(hotMiddleware)
重新 npm run dev
html:
<div id="test">
<div id="child_1">
子1
</div>
<div id="child_2">
子2
</div>
</div>
style:
* {
padding: 0;
margin: 0;
}
#test {
background-color: yellow;
margin: 100px;
display: flex;
flex-direction: row;
height: 200px;
width: 200px;
}
#child_1 {
margin-right: 20px;
background-color: red;
height: 50px; /* 子1定了高度,子2沒有 */
}
#child_2 {
background-color: red;
}
不想自適應(yīng)可給定高度。
你是想問你的應(yīng)用不是放在根路徑下應(yīng)該怎么處理是吧
Router有一個配置項base,可以指定基路徑
const router = new Router( {
base: '/lessoners/'
} )
具體的自己看文檔吧
https://router.vuejs.org/zh-c...
兄弟問題解決了嗎, 我也遇到了,怎么依賴都找不到PDFJS這個對象
innerHTML
不知道你iframe代碼的結(jié)構(gòu)和內(nèi)容。嘗試下,把iframe中的內(nèi)容放到一個 .html中,然后在你需要加標識的地方用a標簽套你的img,把href屬性指到剛剛那個.html。
不是默認LTE就能上網(wǎng)嗎?你試試改為LTE呢
activaed這個是keep-alive的生命周期 看你怎么寫的 如果actived中觸發(fā)了 created是不會觸發(fā)的keep-alive是緩存頁面
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產(chǎn)業(yè)鏈。利用北京大學優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓領(lǐng)域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務(wù)負責iOS教學及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。