我和你报同一个错误 可以参考下我的
setFonts () {
const dropdownList = [
{
text: '微软雅黑',
value: '微软雅黑'
},
{
text: '宋体',
value: '宋体'
},
{
text: '黑体',
value: '黑体'
},
{
text: '仿宋',
value: '仿宋'
},
{
text: '华文行楷',
value: '华文行楷'
},
{
text: '楷体',
value: '楷体'
},
{ text: 'Arial', value: 'Arial' },
{ text: 'Arial Black', value: 'Arial Black' },
{ text: 'Calibri', value: 'Calibri' },
{ text: 'Cambria', value: 'Cambria' },
{ text: 'Candara', value: 'Candara' },
{ text: 'Century', value: 'Century' },
{ text: 'Courier New', value: 'Courier New' },
{ text: 'Comic Sans MS', value: 'Comic Sans MS' },
{ text: 'Garamond', value: 'Garamond' },
{ text: 'Georgia', value: 'Georgia' },
{ text: 'Malgun Gothic', value: 'Malgun Gothic' },
{ text: 'Mangal', value: 'Mangal' },
{ text: 'Meiryo', value: 'Meiryo' },
{ text: 'MS Gothic', value: 'MS Gothic' },
{ text: 'MS Mincho', value: 'MS Mincho' },
{ text: 'MS PGothic', value: 'MS PGothic' },
{ text: 'MS PMincho', value: 'MS PMincho' },
{ text: 'Tahoma', value: 'Tahoma' },
{ text: 'Times', value: 'Times' },
{ text: 'Times New Roman', value: 'Times New Roman' },
{ text: 'Trebuchet MS', value: 'Trebuchet MS' },
{ text: 'Verdana', value: 'Verdana' },
{ text: 'Wingdings', value: 'Wingdings' }
]
const designerConfig = JSON.parse(
JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
)
const fontFamilyCommand = GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.FontFamily)
fontFamilyCommand.dropdownList = dropdownList
designerConfig.commandMap = {
fontFamily: fontFamilyCommand
}
GC.Spread.Sheets.Designer.findControl('ssDesigner').setConfig(designerConfig)
},
|