-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(element-plus): migrate to typescript and vite
- Loading branch information
1 parent
2f3dc0a
commit 7c44b00
Showing
18 changed files
with
304 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="icon" href="/favicon.ico"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<template> | ||
<div> | ||
{{ period.prefix.value }} | ||
|
||
<custom-select | ||
:model-value="period.selected.value.id" | ||
item-value="id" | ||
:items="period.items" | ||
@update:model-value="period.select($event)" | ||
:button-props="buttonProps" | ||
/> | ||
|
||
{{ period.suffix.value }} | ||
|
||
<template v-for="f in selected" :key="f.id"> | ||
{{ f.prefix.value }} | ||
|
||
<div class="vcron-el-spacer"> | ||
<custom-select | ||
:model-value="f.selected.value" | ||
@update:model-value="f.select($event)" | ||
:items="f.items" | ||
:cols="cols[f.id] || 1" | ||
:selection="f.text.value" | ||
multiple | ||
clearable | ||
:button-props="buttonProps" | ||
:dropdown-props="{ hideOnClick: false }" | ||
/> | ||
</div> | ||
|
||
{{ f.suffix.value }} | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import CustomSelect from '@/components/select.vue' | ||
import { cronCoreProps, setupCron } from '@vue-js-cron/core' | ||
import { defineComponent, type ExtractPropTypes } from 'vue' | ||
export const cronElementPlusProps = () => ({ | ||
/** | ||
* Properties of Element Plus Button | ||
* | ||
* @remarks | ||
* See {@link https://element-plus.org/en-US/component/button.html#button-attributes} | ||
*/ | ||
buttonProps: { | ||
type: Object, | ||
default() { | ||
return {} | ||
}, | ||
}, | ||
...cronCoreProps(), | ||
}) | ||
/** | ||
* Props of {@link CronElementPlus} | ||
* | ||
* See {@link @vue-js-cron/core!CronCoreProps | CronCoreProps} for a detailed description of each prop | ||
* | ||
* @interface | ||
*/ | ||
export type CronElementPlusProps = Partial< | ||
ExtractPropTypes<ReturnType<typeof cronElementPlusProps>> | ||
> | ||
export default defineComponent({ | ||
name: 'VueCronEditor', | ||
components: { | ||
CustomSelect, | ||
}, | ||
props: cronElementPlusProps(), | ||
emits: ['update:model-value', 'error'], | ||
setup(props, ctx) { | ||
return setupCron(props, () => props.modelValue, ctx) | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="css"> | ||
.vcron-el-spacer { | ||
display: inline-block; | ||
padding: 3px; | ||
} | ||
</style> |
Oops, something went wrong.