Skip to content

Commit db0ffdc

Browse files
add thrid party
1 parent 79a2143 commit db0ffdc

File tree

8 files changed

+2190
-288
lines changed

8 files changed

+2190
-288
lines changed

docs/app.js

Lines changed: 2032 additions & 270 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
6.02 KB
Binary file not shown.
10.8 KB
Binary file not shown.

example/App.vue

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
<template>
22
<div id="app">
33
<div class="logo">
4-
<a
5-
href="https://github.com/SortableJS/Vue.Draggable"
6-
target="_blank"
7-
><img
8-
alt="Vue logo"
9-
src="./assets/logo.png"
10-
/></a>
4+
<a href="https://github.com/SortableJS/Vue.Draggable" target="_blank"
5+
><img alt="Vue logo" src="./assets/logo.png"
6+
/></a>
117
</div>
128

139
<div class="container ">
14-
<ul
15-
class="nav nav-tabs"
16-
role="tablist"
17-
>
10+
<ul class="nav nav-tabs" role="tablist">
1811
<li
1912
class="nav-item"
2013
v-for="component in componentList"
@@ -27,14 +20,12 @@
2720
:href="`#${component.name}`"
2821
role="tab"
2922
aria-controls="profile"
30-
>{{ component.display }}</a>
23+
>{{ component.display }}</a
24+
>
3125
</li>
3226
</ul>
3327

34-
<div
35-
class="tab-content"
36-
id="tab-content"
37-
>
28+
<div class="tab-content" id="tab-content">
3829
<div
3930
class="tab-pane show"
4031
:id="component.name"
@@ -72,9 +63,8 @@ import $ from "jquery";
7263
const requireContext = require.context("./components/", false, /\.vue$/);
7364
7465
const components = requireContext.keys().reduce((acc, key) => {
75-
const name = key.replace(/^\.\//, "").replace(/\.\w+$/, "");
7666
const component = requireContext(key).default;
77-
acc[name] = component;
67+
acc[component.name] = component;
7868
return acc;
7969
}, {});
8070

example/components/third-party.vue

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<template>
2+
<div class="row">
3+
<div class="col-7">
4+
<h3>
5+
Integration with
6+
<a
7+
href="https://element.eleme.io/#/en-US/component/collapse#collapse"
8+
target="_blank"
9+
>Element collapse</a
10+
>
11+
</h3>
12+
13+
<draggable
14+
element="el-collapse"
15+
:list="list"
16+
:component-data="collapseComponentData"
17+
>
18+
<el-collapse-item
19+
v-for="item in list"
20+
:key="item.id"
21+
:title="item.title"
22+
:name="item.id"
23+
>
24+
<div v-for="(lign, idx) in item.text" :key="idx">{{ lign }}</div>
25+
</el-collapse-item>
26+
</draggable>
27+
</div>
28+
<rawDisplayer class="col-3" :value="list" title="List" />
29+
<rawDisplayer class="col-1" :value="activeNames" title="activeNames" />
30+
</div>
31+
</template>
32+
33+
<script>
34+
import "element-ui/lib/theme-chalk/index.css";
35+
import draggable from "@/vuedraggable";
36+
37+
export default {
38+
name: "third-party",
39+
display: "Third party",
40+
order: 8,
41+
components: {
42+
draggable
43+
},
44+
data() {
45+
return {
46+
list: [
47+
{
48+
title: "Consistency",
49+
id: 1,
50+
text: [
51+
"Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;",
52+
"Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc."
53+
]
54+
},
55+
{
56+
title: "Feedback",
57+
id: 2,
58+
text: [
59+
"Operation feedback: enable the users to clearly perceive their operations by style updates and interactive effects;",
60+
"Visual feedback: reflect current state by updating or rearranging elements of the page."
61+
]
62+
},
63+
{
64+
title: "Efficiency",
65+
id: 3,
66+
text: [
67+
"Simplify the process: keep operating process simple and intuitive;",
68+
"Definite and clear: enunciate your intentions clearly so that the users can quickly understand and make decisions;",
69+
"Easy to identify: the interface should be straightforward, which helps the users to identify and frees them from memorizing and recalling."
70+
]
71+
},
72+
{
73+
title: "Controllability",
74+
id: 4,
75+
text: [
76+
"Decision making: giving advices about operations is acceptable, but do not make decisions for the users;",
77+
"Controlled consequences: users should be granted the freedom to operate, including canceling, aborting or terminating current operation."
78+
]
79+
}
80+
],
81+
activeNames: [1],
82+
collapseComponentData: {
83+
on: {
84+
input: this.inputChanged
85+
},
86+
props: {
87+
value: this.activeNames
88+
}
89+
}
90+
};
91+
},
92+
methods: {
93+
inputChanged(val) {
94+
this.activeNames = val;
95+
}
96+
}
97+
};
98+
</script>
99+
<style scoped></style>

example/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import App from "./App.vue";
33
import VueRouter from "vue-router";
44
import routes from "./route";
55
import rawDisplayer from "./components/infra/raw-displayer.vue";
6+
import ElementUI from "element-ui";
67

78
import "bootstrap/dist/css/bootstrap.min.css";
89
import "font-awesome/css/font-awesome.css";
@@ -16,6 +17,8 @@ const router = new VueRouter({
1617
Vue.config.productionTip = false;
1718
Vue.use(VueRouter);
1819
Vue.component("rawDisplayer", rawDisplayer);
20+
Vue.use(ElementUI);
21+
1922
new Vue({
2023
router,
2124
render: h => h(App)

package-lock.json

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"babel-jest": "^23.6.0",
3939
"bootstrap": "^4.3.1",
4040
"component-fixture": "^0.4.1",
41+
"element-ui": "^2.5.4",
4142
"eslint": "^5.8.0",
4243
"eslint-plugin-vue": "^5.0.0",
4344
"font-awesome": "^4.7.0",

0 commit comments

Comments
 (0)