Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/sites/demos/app/alert/close-text-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
</template>

<script setup lang="jsx">
import { Alert as TinyAlert } from '@opentiny/vue'
import { alert } from '@opentiny/vue-modal'
import { Alert as TinyAlert, Modal } from '@opentiny/vue'

function close() {
alert('关闭了')
Modal.alert('关闭了')
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/alert/close-text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
</template>

<script lang="jsx">
import { Alert } from '@opentiny/vue'
import { alert } from '@opentiny/vue-modal'
import { Alert, Modal } from '@opentiny/vue'

export default {
components: {
TinyAlert: Alert
},
methods: {
close() {
alert('关闭了')
Modal.alert('关闭了')
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions examples/sites/demos/app/anchor/on-change-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

<script setup>
import { ref } from 'vue'
import { Anchor as TinyAnchor } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { Anchor as TinyAnchor, Modal } from '@opentiny/vue'

const links = ref([
{
Expand Down Expand Up @@ -43,6 +42,6 @@ const links = ref([
])

function handleChange(link) {
message(`change${link}`)
Modal.message(`change${link}`)
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/anchor/on-change.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
</template>

<script>
import { Anchor } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { Anchor, Modal } from '@opentiny/vue'

export default {
components: {
Expand Down Expand Up @@ -50,7 +49,7 @@ export default {
},
methods: {
handleChange(link) {
message(`change${link}`)
Modal.message(`change${link}`)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
</template>

<script setup lang="jsx">
import { Dept as TinyDept } from '@opentiny/vue'
import { confirm } from '@opentiny/vue-modal'
import { Dept as TinyDept, Modal } from '@opentiny/vue'
import { ref } from 'vue'

const value = ref('022471')

function beforeConfirm() {
return new Promise((resolve, reject) => {
confirm('确定关闭弹框?').then((res) => {
Modal.confirm('确定关闭弹框?').then((res) => {
res === 'confirm' ? resolve() : reject(new Error())
})
})
Expand Down
5 changes: 2 additions & 3 deletions examples/sites/demos/app/dept/before-confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
</template>

<script lang="jsx">
import { Dept } from '@opentiny/vue'
import { confirm } from '@opentiny/vue-modal'
import { Dept, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -23,7 +22,7 @@ export default {
methods: {
beforeConfirm() {
return new Promise((resolve, reject) => {
confirm('确定关闭弹框?').then((res) => {
Modal.confirm('确定关闭弹框?').then((res) => {
res === 'confirm' ? resolve() : reject(new Error())
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const uploadRef = ref()

function cancelUpload() {
message('手动取消上传')
Modal.message('手动取消上传')
uploadRef.value.abort()
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/file-upload/abort-quest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -24,7 +23,7 @@ export default {
},
methods: {
cancelUpload() {
message('手动取消上传')
Modal.message('手动取消上传')
this.$refs.upload.abort()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const fileList = ref([
Expand All @@ -32,12 +31,12 @@ const fileList = ref([
])

function beforeRemove() {
message('触发删除文件前回调事件')
Modal.message('触发删除文件前回调事件')
return true
}

function beforeAvatarUpload() {
message('触发上传前回调事件')
Modal.message('触发上传前回调事件')
return true
}
</script>
7 changes: 3 additions & 4 deletions examples/sites/demos/app/file-upload/custom-prefix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -40,11 +39,11 @@ export default {
},
methods: {
beforeRemove() {
message('触发删除文件前回调事件')
Modal.message('触发删除文件前回调事件')
return true
},
beforeAvatarUpload() {
message('触发上传前回调事件')
Modal.message('触发上传前回调事件')
return true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const fileList = ref([
Expand All @@ -30,7 +29,7 @@ const headers = ref({
})

function beforeUpload() {
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
return true
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -38,7 +37,7 @@ export default {
},
methods: {
beforeUpload() {
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
return true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload } from '@opentiny/vue'
import { FileUpload as TinyFileUpload, Modal } from '@opentiny/vue'
import { iconFileupload } from '@opentiny/vue-icon'
import { message } from '@opentiny/vue-modal'

const action = ref('http://localhost:3000/api/upload')

const TinyIconFileupload = iconFileupload()

function dropErrorHandler(files) {
message(`有${files.length}个文件拖拽失败`)
Modal.message(`有${files.length}个文件拖拽失败`)
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/file-upload/drag-upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
</template>

<script lang="jsx">
import { FileUpload } from '@opentiny/vue'
import { FileUpload, Modal } from '@opentiny/vue'
import { IconFileupload } from '@opentiny/vue-icon'
import { message } from '@opentiny/vue-modal'

export default {
components: {
Expand All @@ -22,7 +21,7 @@ export default {
},
methods: {
dropErrorHandler(files) {
message(`有${files.length}个文件拖拽失败`)
Modal.message(`有${files.length}个文件拖拽失败`)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const requestData = ref({
id: 123
})

function beforeUpload() {
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
return true
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/file-upload/jalor-request.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -24,7 +23,7 @@ export default {
},
methods: {
beforeUpload() {
message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
Modal.message('查看请求头示例请打开浏览器开发者工具 network 的 upload 请求')
return true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const limit = ref(1)

function handleExceed() {
message(`文件个数不能超过${limit.value}个`)
Modal.message(`文件个数不能超过${limit.value}个`)
}
</script>
5 changes: 2 additions & 3 deletions examples/sites/demos/app/file-upload/max-file-count.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { message } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -21,7 +20,7 @@ export default {
},
methods: {
handleExceed() {
message(`文件个数不能超过${this.limit}个`)
Modal.message(`文件个数不能超过${this.limit}个`)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { confirm } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const fileList = ref([
Expand All @@ -21,7 +20,7 @@ const fileList = ref([

function beforeRemove(file) {
return new Promise((resolve, reject) => {
confirm(`确定移除 ${file.name}?`).then((res) => {
Modal.confirm(`确定移除 ${file.name}?`).then((res) => {
res === 'confirm' ? resolve() : reject(new Error())
})
})
Expand Down
5 changes: 2 additions & 3 deletions examples/sites/demos/app/file-upload/prevent-delete-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
</template>

<script lang="jsx">
import { FileUpload, Button } from '@opentiny/vue'
import { confirm } from '@opentiny/vue-modal'
import { FileUpload, Button, Modal } from '@opentiny/vue'

export default {
components: {
Expand All @@ -29,7 +28,7 @@ export default {
methods: {
beforeRemove(file) {
return new Promise((resolve, reject) => {
confirm(`确定移除 ${file.name}?`).then((res) => {
Modal.confirm(`确定移除 ${file.name}?`).then((res) => {
res === 'confirm' ? resolve() : reject(new Error())
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

<script setup lang="jsx">
import { ref } from 'vue'
import { FileUpload as TinyFileUpload, Button as TinyButton } from '@opentiny/vue'
import { confirm } from '@opentiny/vue-modal'
import { FileUpload as TinyFileUpload, Button as TinyButton, Modal } from '@opentiny/vue'

const action = ref('http://localhost:3000/api/upload')
const fileList = ref([
Expand All @@ -21,7 +20,7 @@ const fileList = ref([

function beforeUpload(file) {
return new Promise((resolve, reject) => {
confirm(`确定要上传 ${file.name}?`).then((res) => {
Modal.confirm(`确定要上传 ${file.name}?`).then((res) => {
res === 'confirm' ? resolve() : reject()
})
})
Expand Down
Loading