Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cg_approveApp_2023
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
cg_approveApp_2023
Commits
cb06428c
Commit
cb06428c
authored
Oct 08, 2020
by
miko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aa
parent
9b1124a0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
310 deletions
+138
-310
.idea/vcs.xml
.idea/vcs.xml
+6
-0
src/app.wpy
src/app.wpy
+1
-1
src/assets/close.png
src/assets/close.png
+0
-0
src/components/counter.wpy
src/components/counter.wpy
+0
-77
src/components/group.wpy
src/components/group.wpy
+0
-41
src/components/groupitem.wpy
src/components/groupitem.wpy
+0
-28
src/pages/index.wpy
src/pages/index.wpy
+131
-163
No files found.
.idea/vcs.xml
0 → 100644
View file @
cb06428c
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
src/app.wpy
View file @
cb06428c
...
...
@@ -2,9 +2,9 @@
.container {
height: 100%;
display: flex;
overflow-y: scroll;
flex-direction: column;
align-items: center;
box-sizing: border-box;
background: #F5F5F5;
}
page{
...
...
src/assets/close.png
0 → 100644
View file @
cb06428c
1.35 KB
src/components/counter.wpy
deleted
100644 → 0
View file @
9b1124a0
<style lang="less">
.counter {
text-align: left;
font-size: 12px;
}
.count {
font-size: 18px;
font-weight: bold;
&.red {
color: red;
}
&.green {
color: green;
}
}
</style>
<template>
<div class="counter {{style}}">
<button @tap="plus" size="mini"> + </button>
<button @tap="minus" size="mini"> - </button>
<button @tap="increment" size="mini"> INCREMENT </button>
<button @tap="decrement" size="mini"> DECREMENT </button>
<button @tap="incrementAsync" size="mini"> ASYNC INCREMENT </button>
<span class="count"> {{counter}} </span>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '../store';
import { mapState, mapActions } from '@wepy/x';
wepy.component({
store,
props: {
num: {
type: [Number, String],
coerce: function (v) {
return +v
},
default: 50
}
},
computed: mapState([ 'counter' ]),
events: {
'index-broadcast': (...args) => {
let $event = args[args.length - 1]
console.log(`${this.$name} receive ${$event.name} from ${$event.source.$name}`)
}
},
watch: {
num (curVal, oldVal) {
console.log(`旧值:${oldVal},新值:${curVal}`)
}
},
methods: {
...mapActions([
'increment',
'decrement',
'incrementAsync'
]),
plus () {
this.num = this.num + 1
console.log('plus tapped in component');
this.$emit('index-emit', this.num);
},
minus () {
this.num = this.num - 1
console.log(this.$name + ' minus tap')
}
}
})
</script>
src/components/group.wpy
deleted
100644 → 0
View file @
9b1124a0
<style type="less">
.group {}
</style>
<template>
<div class="group">
<span class="id">{{grouplist.id}}. </span>
<span class="name" @tap="tap">{{grouplist.name}}</span>
<div>
<div v-for="item in grouplist.list">
<groupitem :gitem="item"></groupitem>
</div>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core';
//import GroupItem from './groupitem'
wepy.component({
props: {
grouplist: {},
index: {}
},
methods: {
tap () {
this.grouplist.name = `Parent Random(${Math.random()})`
let groups = this.$parent.$children.filter(com => com.$is === 'components/group');
let index = groups.indexOf(this);
console.log(`Clicked Group ${index}, ID is ${this.grouplist.id}`)
}
}
});
</script>
<config>
{
usingComponents: {
'groupitem': './groupitem'
}
}
</config>
src/components/groupitem.wpy
deleted
100644 → 0
View file @
9b1124a0
<style type="less">
.groupitem {
}
</style>
<template>
<div class="groupitem">
--<span class="id">{{gitem.childid}}.</span>
<span class="name" @tap="tap"> {{gitem.childname}}</span>
</div>
</template>
<script>
import wepy from '@wepy/core';
wepy.component({
props: {
gitem: {}
},
data: {
},
methods: {
tap () {
this.gitem.childname = `Child Random(${Math.random()})`
let index = this.$parent.$children.indexOf(this);
console.log(`Item ${index}, ID is ${this.gitem.childid}`)
}
}
});
</script>
src/pages/index.wpy
View file @
cb06428c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment