mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
fix: defineRouteMeta parse 异常
This commit is contained in:
parent
52c06ff20f
commit
b8878c3c24
@ -71,7 +71,9 @@ function getRouteMeta(content) {
|
||||
)[0];
|
||||
if (defineRouteExpression) {
|
||||
const argument = generator(defineRouteExpression.expression.arguments[0]);
|
||||
return JSON.parse(argument.code.replace(/'/g, '"').replace(/(\S+):/g, (global, m1) => `"${m1}":`));
|
||||
// eslint-disable-next-line no-eval
|
||||
const fn = eval(`() => (${argument.code})`);
|
||||
return fn();
|
||||
}
|
||||
} catch (err) {}
|
||||
return null;
|
||||
|
@ -6,10 +6,14 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useI18n } from '@fesjs/fes';
|
||||
<script lang="ts">
|
||||
import { useI18n, defineRouteMeta } from '@fesjs/fes';
|
||||
import { FButton } from '@fesjs/fes-design';
|
||||
|
||||
defineRouteMeta({
|
||||
'keep-alive': true,
|
||||
});
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FButton,
|
||||
|
Loading…
x
Reference in New Issue
Block a user