Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

import js as a configuration file in vue, but the imported module will not be reloaded when switching between English and Chinese #1654

Open
3 tasks done
774274680 opened this issue Feb 22, 2023 · 1 comment
Labels
Status: Proposal Request for comments

Comments

@774274680
Copy link

Clear and concise description of the problem

test.vue

<template>
  <div>
    <el-pagination
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400"
    >
    </el-pagination>
    <button @click="changeLangue">点击切换语言</button>
    <my-form v-bind="formConfig" v-model="formData"></my-form>
  </div>
</template>
<script>
import formConfig from './form-config'
export default {
  data() {
    return {
      formConfig,
    }
  },
</script>

form-config.js

import i18n from '@/language'
const formConfig = {
  formItems: [
    {
      type: 'input',
      prop: 'name',
      label: i18n.t('name'),
      placeholder: i18n.t('nameRequire'),
    },
  ],
  labelWidth: '120px',
}

export default formConfig

Suggested solution

js

Alternative

No response

Additional context

No response

Validations

@774274680 774274680 added the Status: Proposal Request for comments label Feb 22, 2023
@appleqzw
Copy link

appleqzw commented Mar 7, 2024

I'm having the same problem, is there a solution at the moment?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

2 participants