We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述
useReady(() => { getChildComponent(); }); const getChildComponent = () => { const { page } = getCurrentInstance(); const calendar = page.selectComponent("calendar"); console.log(calendar); };
在taro里获取打印出来为null
null
The text was updated successfully, but these errors were encountered:
<template> <div class="calendarWrapper"> <calendar class="calendar" :config="state.config" :afterCalendarRender="afterCalendarRender" /> </div> <footTab /> </template> <script setup> import { reactive, ref } from "vue"; import Taro, { useReady, getCurrentInstance } from "@tarojs/taro"; import footTab from "@/components/common/footTab"; function afterCalendarRender(e) { console.log("afterCalendarRender: ", e); } definePageConfig({ navigationBarTitleText: "打卡详情", usingComponents: { calendar: "../../../components/wx_calendar/v2/index", }, }); const state = reactive({ config: { multi: true, // 是否开启多选, onlyShowCurrentMonth: true, // 日历面板是否只显示本月日期 }, }); useReady(() => { getChildComponent(); }); const getChildComponent = () => { const { page } = getCurrentInstance(); // console.log(page); const calendar = page.selectComponent(".calendar"); console.log(calendar); }; </script> <style lang="scss" module> .calendarWrapper { display: flex; width: 100%; overflow: hidden; } </style>
可以成功了,关键代码
function afterCalendarRender(e) { console.log("afterCalendarRender: ", e); }
Sorry, something went wrong.
treadpit
No branches or pull requests
问题描述
在taro里获取打印出来为
null
The text was updated successfully, but these errors were encountered: