前端实践整理

jQuery 事件 - mouseover() 方法
当鼠标指针位于元素上方时,会发生 mouseover 事件。

html() 方法返回或设置被选元素的内容 (inner HTML)。

block元素通常被现实为独立的一块,会单独换一行;inline元素则前后不会产生换行,一系列inline元素都在一行内显示,直到该行排满。
display:inline-block
简单来说就是将对象呈现为inline对象,但是对象的内容作为block对象呈现。

    td{
        width:100%;
    word-break:keep-all;/* 不换行 */
    white-space:nowrap;/* 不换行 */
    overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
    text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
    }

td才对,table.td不对

这是jquey下的内容:

 理解 $(function(){}) 表示文档加载。看上去略复杂,其实是由下面两种构成:
一样功能,还有另一个写法$(document).ready(function(){});

v-bind:src= 中间没有空格

结果出不来时,检查VUE的指定域是否有问题

data中定义变量时,没有赋属性的话,函数中的操作是无效的。

    new Vue({        
    	el:'#songlist_love',         
    	data:{
            song_play:{                
            title: 'secret base~君がくれたもの~',                
            artist: 'Silent Siren',                
            src: 'https://api.itooi.cn/music/tencent/url?key=579621905&id=001fXNWa3t8EQQ&br=192',  
            pic: 'https://moeplayer.b0.upaiyun.com/aplayer/secretbase.jpg'}            },


                play_music:function(name,url,singername){                    
                //document.getElementById("p_aplayer").
                innerHTML=url;                    
                this.song_play.title=name;                    
                this.song_play.src=url;                   
                 this.song_play.artist=singername;                },

对一个区域进行赋值

document.getElementById(“div1”)

div1.innerHTML= gareen.name;
Vue在对属性赋值时要拼接字符串的时候:

v-bind:href="‘songlistpage?id=’+songlist.dissid"
Vue对点击事件监听时,在函数中带入Vue参数:

<button @click=“play_music(song.url)” class=“song_playbutton”>

注意不用{{song.url}}
Vue传递函数参数时

<button @click=“play_music(song.name,song.url,song.singer[0].name)”

注意不用{{song.url}},而且可以一次传多个
Vue使用组件并绑定属性的时候

v-bind:music=“song_play”

属性名原本是为:music的,相当于少了一个:了
v-model 为双向绑定

猜你喜欢

转载自blog.csdn.net/Fishandbearspaw/article/details/89470347