All Projects → lin-xin → Notepad

lin-xin / Notepad

基于vue2.0+vuex+localStorage+sass+webpack,实现一个本地存储的记事本。兼容PC端和移动端。

Projects that are alternatives of or similar to Notepad

Vue Music Player
🎵Vue.js写一个音乐播放器+📖One(一个).A music player + One by Vue.js
Stars: ✭ 729 (+22.11%)
Mutual labels:  vuex, localstorage
Vue Shop
VUE移动小商城
Stars: ✭ 148 (-75.21%)
Mutual labels:  vuex, localstorage
Vue Mail List
vue全家桶+localStorage实现一个简易的通讯录
Stars: ✭ 81 (-86.43%)
Mutual labels:  vuex, localstorage
Vuex Along
📝 A plugins to auto save and restore state for vuex
Stars: ✭ 239 (-59.97%)
Mutual labels:  vuex, localstorage
Vuex Localstorage
Persist Vuex state with expires by localStorage or some else storage.
Stars: ✭ 129 (-78.39%)
Mutual labels:  vuex, localstorage
Vuex Persistedstate
💾 Persist and rehydrate your Vuex state between page reloads.
Stars: ✭ 5,561 (+831.49%)
Mutual labels:  vuex, localstorage
Aws Lex Web Ui
Sample Amazon Lex chat bot web interface
Stars: ✭ 500 (-16.25%)
Mutual labels:  vuex
Angular Async Local Storage
Efficient local storage module for Angular apps and PWA: simple API + performance + Observables + validation
Stars: ✭ 539 (-9.72%)
Mutual labels:  localstorage
Dashboard
A dashboard scaffolding based on Vue.js 3.0 created by Vite.
Stars: ✭ 497 (-16.75%)
Mutual labels:  vuex
Meal Prep
Source code for a 4-part series I wrote about Vue, Vue Router, Vuex and Vuetify
Stars: ✭ 496 (-16.92%)
Mutual labels:  vuex
Swiftuitodo
An example to-do list app using SwiftUI which is introduced in WWDC19
Stars: ✭ 585 (-2.01%)
Mutual labels:  todolist
Vuexfire
Check
Stars: ✭ 574 (-3.85%)
Mutual labels:  vuex
Vuetron
A tool for testing and debugging your Vue + Vuex applications. 是一個可以幫助您 Vue.js 的項目測試及偵錯的工具, 也同時支持 Vuex及 Vue-Router.
Stars: ✭ 531 (-11.06%)
Mutual labels:  vuex
Vue Music
cloud-music(网易云音乐)
Stars: ✭ 500 (-16.25%)
Mutual labels:  vuex
Vue Mintshop
🍖 🍉 使用 ES6 + Mock.js + vue2.0 全家桶开发的前后端分离的外卖App。开发文档、流程完整详尽,非常适合作为个人练手项目。
Stars: ✭ 552 (-7.54%)
Mutual labels:  vuex
Blog.admin
✨ 基于vue 的管理后台,配合Blog.Core与Blog.Vue等多个项目使用
Stars: ✭ 500 (-16.25%)
Mutual labels:  vuex
Web Storage Cache
对localStorage 和sessionStorage 进行了扩展,添加了超时时间,序列化方法
Stars: ✭ 582 (-2.51%)
Mutual labels:  localstorage
Vue Music Webapp
🎵💞🐔基于Vue 全家桶 (2.x)制作的移动端音乐 WebApp 。媲美原生、项目完整、功能完备、UI美观、交互一流。
Stars: ✭ 499 (-16.42%)
Mutual labels:  vuex
Taskwiki
Proper project management with Taskwarrior in vim.
Stars: ✭ 528 (-11.56%)
Mutual labels:  todolist
Full Stack Fastapi Postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Stars: ✭ 7,635 (+1178.89%)
Mutual labels:  vuex

基于vue2.0+vuex+localStorage开发的本地记事本

本文采用vue2.0+vuex+localStorage+sass+webpack,实现一个本地存储的记事本。兼容PC端和移动端。在线预览地址:DEMO

功能说明

  • 支持回车添加事件
  • 支持事件状态切换
    • 添加事件 -> 进入未完成列表
    • 未完成 -> 已完成(勾选checkbox)
    • 未完成 -> 已取消(点击取消按钮)
    • 已完成 -> 未完成(取消勾选checkbox)
    • 已取消 -> 未完成(点击恢复按钮)
  • 支持筛选事件
  • 支持编辑事件
  • 支持删除事件
  • 支持清空所有事件
  • 支持本地化存储
  • 支持折叠面板
  • 支持切换主题颜色 ✨
  • 支持导出/导入数据

安装步骤

本项目是使用vue-cli脚手架生成的项目,项目代码可以到我的github上clone下来。clone下来之后可进入文件目录

git clone https://github.com/lin-xin/notepad.git
cd notepad
npm install
npm run dev

// 如果 node-sass 安装失败,可使用 cnpm 安装
npm install cnpm -g --registry=https://registry.npm.taobao.org
cnpm -v 			// 查看cnpm版本号确认安装成功
cnpm install node-sass -D

//安装成功后再看看是否可以正确运行了

功能截图

image image

主要难点

1.折叠面板

难点:点击折叠面板title,要动画实现sliderUp和sliderDown,但是div高度auto,使用transition: height .3s无效。

解决方法:点击时候获取div高度值,赋值给style.height,然后再改变高度为0,这样transition才会生效。

2.切换状态

难点:在不同的状态间切换,实时地把事件在不同状态列表中显示出来

解决方法:利用vuex进行状态管理,把所有事件和状态存储在store对象中,在组件中通过计算属性获得事件,因此就有了实时性。 关于vuex在该项目中更详细的应用可查看文章:Vuex 模块化实现待办事项的状态管理

3.本地存储

知识点:localStorage是HTML5提供的一种在客户端存储数据的新方法,没有时间限制,第二天、第二周或下一年之后,数据依然可用。

用法:

1)存储数据:localStorage.setItem(item, value)
2)获取数据:localStorage.getItem(item)
3)移除数据:localStorage.removeItem(item)

4.父子组件间的通讯

知识点:组件实例的作用域是孤立的。这意味着不能并且不应该在子组件的模板内直接引用父组件的数据。

1)父组件可以使用 props 把数据传给子组件。
2)子组件可以使用 $emit 触发父组件的自定义事件。

5.筛选功能

功能描述:可根据 类型 和 关键词 进行筛选

知识点:在返回所有事件的计算属性上,使用过滤器( filter ),进行对 type 和 content 的筛选,返回符合条件的事件。

6.切换主题

功能描述:通过点击选中的颜色,改变整个记事本的主题风格,并永久保存。

知识点:使用vuex管理主题状态,并进行模块化管理,用localStorage永久存储选中的主题颜色。

7.数据的导出和导入

总结

虽然只是做了个小小的记事本,但是我感觉收获还是很大的,很多知识点掌握得更加的牢固。这个记事本只做了一个页面,就没有用vue-router,路由也是vue里很强大的功能。 做这个记事本的初衷,是因为在工作中,我都会把最近要做的事情给记在本子上,完成之后就会打钩,所以想把这个给放到电脑上去实现。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].