/*
 * @Author: your name
 * @Date: 2022-01-08 17:11:14
 * @LastEditTime: 2022-01-08 17:20:18
 * @LastEditors: Please set LastEditors
 * @Description: 位置的格式化
 * @FilePath: \goldenPig\src\directives\location-format.js
 */
import { CodeToText } from "element-china-area-data";

export function directiveLocationFormat(app) {
  app.directive('location', (el, binding) => {
    const codes = binding.value.data.split(',')
    let location = ''
    codes.forEach(item => {
      location += CodeToText[item]
    })
    el.innerText = location
  })
}
