Home > Backend Development > PHP Tutorial > javascript - 怎么把这个vue组件拿出来共用?

javascript - 怎么把这个vue组件拿出来共用?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:06:46
Original
1575 people have browsed it

这是我的demo:https://jsfiddle.net/ne92wfxp/8/

有两个问题:
1、在这个foreach循环中,怎么把这个vue组件拿出来共用?
2、我想在打开这个页面的时候,以前选择的选项,怎么显示它?而不是每次打开该页面的时候,选项都是“请选择”。

回复内容:

这是我的demo:https://jsfiddle.net/ne92wfxp/8/

有两个问题:
1、在这个foreach循环中,怎么把这个vue组件拿出来共用?
2、我想在打开这个页面的时候,以前选择的选项,怎么显示它?而不是每次打开该页面的时候,选项都是“请选择”。

把你要迭代的代码抽出来,弄成组件,内部值通过props传入

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template