一个GitHub官方的为Visual Studio项目量身定做的gitignore文件,直接在项目根目录下提交这个文件即可。


## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the

在 Vue 的开发过程中,有时候会遇到根据不同人的权限加载不同的路由问题,经过一番测试,找到了一个解决方案,举例如:

  1. 在 router 文件夹下新建一个 config.json 文件,来作为 router 的数据源
[
  {
    "title": "Dashboard",
    "path": "/main/",
    "src": "dashboard",
    "summary": "statistics, charts, recent events and reports",
    "children": []
  },
  {
    "title": "Menu Example",
    "heading": true
  },
  {
    "title": "Multi Level Menu",
    "summary": "",
    "children": [
      {
        "title": "Item 1",
        "summary": "",
        "children": [
          {
            "title": "Item 11",
            "summary": "",
            "path": "/main/1",
            "children": []
          },
          {
            "title": "Item 12",
            "summary": "",
            "path": "/main/1",
            "children": []
          },
          {
            "title": "Item 13",
            "summary": "",
            "path": "/main/1",
            "children": []
          }
        ]
      },
      {
        "title": "Item 2",
        "summary": "",
        "path": "/main/1",
        "children": []
      },
      {
        "title": "Item 3",
        "summary": "",
        "path": "/main/1",
        "children": []
      }
    ]
  }

通过使用 JQuery 的滑动动画 sildeDown() 与 slideUp() 方法实现一个 Accordion 效果非常简单。

其功能是以动画的效果调整所选元素的高度,使其呈现一种“滑动”的效果,而元素的其他属性不发生变化;参数 speed 为动画显示的速度,可选项 [callback] 为动画显示完成后,执行的回调函数。

如果使用 CSS3 实现这个效果,需要实现的特点和解决的问题有五个:

  1. 以“滑动”的动画效果动态调整显示区域
  2. 所选的元素不设高度,其高度由子元素的多少自适应
  3. 可在调整显示区域的同时不占位置
  4. 可通过参数调整动画显示速度
  5. 可选项 [callback] 为动画显示完成后,执行的回调函数

确认好了问题,我准备从构建一个 Panel 开始。

在一些情况下,我们可能会需要对一个 prop 进行『双向绑定』。事实上,这正是 Vue 1.x 中的 .sync修饰符所提供的功能。当一个子组件改变了一个 prop 的值时,这个变化也会同步到父组件中所绑定的值。这很方便,但也会导致问题,因为它破坏了『单向数据流』的假设。

由于子组件改变 prop 的代码和普通的状态改动代码毫无区别,当光看子组件的代码时,你完全不知道它何时悄悄地改变了父组件的状态。这在 debug 复杂结构的应用时会带来很高的维护成本。