|
@@ -16,18 +16,31 @@ import styles from './index.module.less'
|
|
|
import { params as classInfo } from '../class-info'
|
|
|
import { Button, Cell, Dialog, Popup, Sticky, Tag, Toast } from 'vant'
|
|
|
import { getWeekCh } from '@/helpers/utils'
|
|
|
-import { active } from '../index'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import CourseSchedule from '../course-schedule'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'createClass',
|
|
|
- setup() {
|
|
|
- watch(active, () => {
|
|
|
- if (active.value === 2) {
|
|
|
- getList()
|
|
|
+ props: {
|
|
|
+ active: {
|
|
|
+ type: Number,
|
|
|
+ default: 1
|
|
|
+ },
|
|
|
+ onBack: {
|
|
|
+ type: Function,
|
|
|
+ default: () => () => {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setup(props) {
|
|
|
+ watch(
|
|
|
+ () => props.active,
|
|
|
+ val => {
|
|
|
+ console.log(val)
|
|
|
+ if (val === 2) {
|
|
|
+ getList()
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ )
|
|
|
//日期设置
|
|
|
const data = reactive({
|
|
|
calendarList: {},
|
|
@@ -247,7 +260,7 @@ export default defineComponent({
|
|
|
type="primary"
|
|
|
plain
|
|
|
onClick={() => {
|
|
|
- active.value = 1
|
|
|
+ props.onBack && props.onBack()
|
|
|
// 重置选择的课次
|
|
|
data.selectList = []
|
|
|
}}
|