欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Vue便簽的簡單實(shí)現(xiàn)

 更新時間:2023年06月07日 10:23:20   作者:快樂江小魚  
本文主要介紹了Vue便簽的簡單實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

html部分

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>小錢便簽</title>
    <!-- 引入自定義樣式表 -->
    <link rel="stylesheet" type="text/css" href="index.css" rel="external nofollow" />
</head>
<body>
	<!-- 主體區(qū)域 -->
    <section id="app">
        <!-- 輸入框 -->
        <header>
        	<h1 class="title">便簽</h1>
        	<input type="text" v-model="inputValue" autofocus="autofocus" 
                   placeholder="請輸入事項(xiàng)" autocomplete="off" class="new-todo" 
                   @keyup.enter="add"/>
        </header>
    	<!-- 列表區(qū)域 -->
    	<section class="main">
        	<ul class="todo-list">
                <li class="todo" v-for="(item, index) in list">
                	<div class="view">
                        <span class="index">{{ index + 1 }}</span>
                        <label>{{ item }}</label>
                        <button class="destroy" @click="remove(index)">刪除</button>
                    </div>
                </li>
            </ul>
        </section>
    	<!-- 統(tǒng)計(jì)和清空 -->
        <footer class="footer">
            <span class="todo-count" v-if="list.length != 0">{{ list.length }}<strong></strong>@nbsp;items left</span>
            <button @click="clear" v-show="list.length != 0">Clear</button>
        </footer>
    </section>
    <!-- 底部 -->
    <footer class="info">
        <p>
            <a  rel="external nofollow" ><img src="https://www.baidu.com/img/flexible/logo/pc/result.png"/></a>
        </p>
    </footer>    
    <!-- 開發(fā)環(huán)境版本 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
    	var app = new Vue({
            el: '#app',
            data: {
                list: ["糖醋里脊", "紅燒獅子頭", "蒸雞蛋"],
                // 初始化輸入值為空
                inputValue: ""
            },
            methods: {
                add: function() {
                    this.list.push(this.inputValue);
                },
                remove: function(index) {
                    this.list.splice(index, 1);
                },
                clear: function() {
                    this.list = []
                }
            }
        })
    </script>
</body>    
</html>

css樣式表

* {
    padding: 0;
    margin: 0;
}
#app {
    width: 300px;
    /* 盒子居中對齊 */
    margin: 5px auto;
    box-shadow: 0px 3px 10x 2px rgba(0, 0, 0, 0.1);
}
.title {
    font: normal 200 34px '微軟雅黑';
    color: rgb(219, 82, 82);
    text-align: center;
    padding-top: 100px;
    padding-bottom: 10px;
}
.new-todo {
    width: 100%;
    height: 40px;
    padding-left: 10px;
    color: rgb(88, 88, 88);
    box-sizing: border-box;
    border: 1px solid rgb(236, 236, 236);
}
.new-todo:focus {
    outline: none;
}
.footer {
    position: relative;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    border: 1px solid rgb(236, 236, 236);
    background-color: white;
}
.footer span {
    font-size: 12px;
    color: rgb(131, 131, 131);
    float: left;
    line-height: 40px;
}
.todo-count {
    margin-left: 10px;
}
.clear-button {
    margin-left: 170px;
}
.todo {
    list-style: none;
    font-size: 14px;
    font-family: '微軟雅黑';
    color: rgb(88, 88, 88);
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    line-height: 40px;
    border: 1px solid rgb(236, 236, 236);
    background-color: white;
}
.view {
    position: relative;
    margin-left: 10px;
}
.view label {
    width: 200px;
    height: 40px;
    position: absolute;
    /* 超出的文本隱藏 */
    overflow: hidden;
    /* 溢出用省略號表示 */
    text-overflow: ellipsis;
    /* 溢出不換行 */
    white-space: nowrap;
}
.destroy {
    position: absolute;
    right: 10px;
    top: 9px;
    font-size: 12px;
    font-family: '微軟雅黑';
    outline: none;
    border: 1px solid rgb(236, 236, 236);
    color: rgb(255, 111, 111);
    display: none;
}
.view:hover .destroy {
    display: block;
}
.footer button {
    position: absolute;
    right: 10px;
    top: 9px;
    font-size: 12px;
    font-family: '微軟雅黑';
    outline: none;
    border: 0px;
    color: rgb(131, 131, 131);
}
.info {
    margin: 5px auto;
    width: 300px;
}
.info a {
    padding-left: 50px;
}

到此這篇關(guān)于Vue便簽的簡單實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)Vue 便簽內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Vue中mixins混入的介紹和使用詳解

    Vue中mixins混入的介紹和使用詳解

    mixins(混入)是一種分發(fā)?Vue?組件中可復(fù)用功能的非常靈活的方式,這篇文章主要為大家介紹了mixins混入的介紹和使用,需要的可以參考下
    2023-08-08
  • 使用watch監(jiān)聽對象里面值的變化

    使用watch監(jiān)聽對象里面值的變化

    這篇文章主要介紹了使用watch監(jiān)聽對象里面值的變化,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 深入淺析golang zap 日志庫使用(含文件切割、分級別存儲和全局使用等)

    深入淺析golang zap 日志庫使用(含文件切割、分級別存儲和全局使用等)

    這篇文章主要介紹了golang zap 日志庫使用(含文件切割、分級別存儲和全局使用等),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-02-02
  • Vue中$router.push()路由切換及如何傳參和獲取參數(shù)

    Vue中$router.push()路由切換及如何傳參和獲取參數(shù)

    這篇文章主要給大家介紹了關(guān)于Vue中$router.push()路由切換及如何傳參和獲取參數(shù)的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用vue具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2023-03-03
  • Vue首屏性能優(yōu)化組件知識點(diǎn)總結(jié)

    Vue首屏性能優(yōu)化組件知識點(diǎn)總結(jié)

    在本篇文章里小編給大家整理了一篇關(guān)于Vue首屏性能優(yōu)化組件知識點(diǎn)總結(jié),有需要的朋友們可以跟著學(xué)習(xí)下。
    2021-11-11
  • Vue3-新特性defineOptions和defineModel示例詳解

    Vue3-新特性defineOptions和defineModel示例詳解

    在Vue3.3中新引入了defineOptions宏主要是用來定義Option API的選項(xiàng),可以用defineOptions定義任意的選項(xiàng),props、emits、expose、slots除外,本文給大家介紹Vue3-新特性defineOptions和defineModel,感興趣的朋友一起看看吧
    2023-11-11
  • 解決vue無法偵聽數(shù)組及對象屬性的變化問題

    解決vue無法偵聽數(shù)組及對象屬性的變化問題

    這篇文章主要介紹了解決vue無法偵聽數(shù)組及對象屬性的變化問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-07-07
  • Vue.js報錯Failed to resolve filter問題的解決方法

    Vue.js報錯Failed to resolve filter問題的解決方法

    這篇文章主要介紹了Vue.js報錯Failed to resolve filter問題的解決方法,需要的朋友可以參考下
    2016-05-05
  • Vue中常見混淆用法匯總

    Vue中常見混淆用法匯總

    本文主要介紹了在Vue中使用的一些常見混淆用法,包括new Vue()、export default {}、createApp()等,以及如何使用混淆器對代碼進(jìn)行加固,需要的可以參考下
    2023-12-12
  • 詳解vue.js的devtools安裝

    詳解vue.js的devtools安裝

    本篇文章主要介紹了詳解vue.js的devtools安裝 ,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-05-05

最新評論