mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: defineRouteMeta parse 异常
This commit is contained in:
parent
52c06ff20f
commit
b8878c3c24
@ -71,7 +71,9 @@ function getRouteMeta(content) {
|
|||||||
)[0];
|
)[0];
|
||||||
if (defineRouteExpression) {
|
if (defineRouteExpression) {
|
||||||
const argument = generator(defineRouteExpression.expression.arguments[0]);
|
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) {}
|
} catch (err) {}
|
||||||
return null;
|
return null;
|
||||||
|
@ -6,10 +6,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { useI18n } from '@fesjs/fes';
|
import { useI18n, defineRouteMeta } from '@fesjs/fes';
|
||||||
import { FButton } from '@fesjs/fes-design';
|
import { FButton } from '@fesjs/fes-design';
|
||||||
|
|
||||||
|
defineRouteMeta({
|
||||||
|
'keep-alive': true,
|
||||||
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
FButton,
|
FButton,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user