Skip to content

Commit

Permalink
fix: modify ts to js of example
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Jan 20, 2021
1 parent cdf9f78 commit d6d269f
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 62 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-cli/src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('test ${camelize(name)}', async () => {
<${namespace}-${name}/>
</template>
<script lang="ts">
<script>
import { defineComponent } from 'vue'
import ${bigCamelize(name)} from '..'
Expand Down
Empty file.
Empty file.
21 changes: 0 additions & 21 deletions packages/varlet-ui/src/expansion-panel/example/index.vue

This file was deleted.

4 changes: 2 additions & 2 deletions packages/varlet-ui/src/expansion-panels/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</template>

<script lang="ts">
<script>
import { defineComponent, ref } from 'vue'
import ExpansionPanels from '..'
import ExpansionPanel from '../../expansion-panel'
Expand All @@ -67,7 +67,7 @@ export default defineComponent({
const disabled = ref(false)
const value = ref(['1'])
const value1 = ref('1')
const changeHandle = (val: any) => {
const changeHandle = (val) => {
console.log({ val })
console.log(value.value)
}
Expand Down
Empty file.
Empty file.
21 changes: 0 additions & 21 deletions packages/varlet-ui/src/index-anchor/example/index.vue

This file was deleted.

2 changes: 1 addition & 1 deletion packages/varlet-ui/src/loading/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
</template>

<script lang="ts">
<script>
import { defineComponent } from 'vue'
import Loading from '..'
Expand Down
8 changes: 4 additions & 4 deletions packages/varlet-ui/src/progress/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
</div>
</template>

<script lang="ts">
import { defineComponent, ref, Ref, onMounted, onUnmounted } from 'vue'
<script>
import { defineComponent, ref, onMounted, onUnmounted } from 'vue'
import Progress from '..'
export default defineComponent({
Expand All @@ -92,8 +92,8 @@ export default defineComponent({
[Progress.name]: Progress,
},
setup() {
const value: Ref<number> = ref(0)
const interval: Ref<number> = ref(0)
const value = ref(0)
const interval = ref(0)
onMounted(() => {
interval.value = window.setInterval(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/pull-refresh/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</var-pull-refresh>
</template>

<script lang="ts">
<script>
import { defineComponent, ref } from 'vue'
import PullRefresh from '..'
Expand Down
22 changes: 11 additions & 11 deletions packages/varlet-ui/src/snackbar/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
</div>
</template>

<script lang="ts">
import { defineComponent, ref, Ref, reactive, toRefs } from 'vue'
<script>
import { defineComponent, ref, reactive, toRefs } from 'vue'
import Button from '../../button'
import Snackbar, { SnackbarType } from '..'
import Snackbar from '..'
export default defineComponent({
name: 'SnackbarExample',
Expand All @@ -101,9 +101,9 @@ export default defineComponent({
[Button.name]: Button,
},
setup() {
const text: Ref<string> = ref("Hello, I'm a snackbar")
const isAllowMultiple: Ref<boolean> = ref(true)
const shows: any = reactive({
const text = ref("Hello, I'm a snackbar")
const isAllowMultiple = ref(true)
const shows = reactive({
show1: false,
show2: false,
show3: false,
Expand All @@ -115,12 +115,12 @@ export default defineComponent({
show11: false,
show12: false,
})
const changeValue = (type: string) => {
const changeValue = (type) => {
shows[type] = !shows[type]
}
const create = (type: any) => {
const snackbar: any = Snackbar({
const create = (type) => {
const snackbar = Snackbar({
content: "Hello, I'm a snackbar",
type,
})
Expand All @@ -129,14 +129,14 @@ export default defineComponent({
}, 1000)
}
const createMethod = (type: SnackbarType) => {
const createMethod = (type) => {
Snackbar[type]({
content: "Hello, I'm a snackbar",
forbidClick: type === 'loading',
})
}
const createPosition = (position: 'top' | 'center' | 'bottom') => {
const createPosition = (position) => {
Snackbar({
content: "Hello, I'm a snackbar",
position,
Expand Down

0 comments on commit d6d269f

Please sign in to comment.