product-edit.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. const Radio = createnRadio();
  2. const Select = createSelect();
  3. const Option = createOption();
  4. const UploadImage = createUploadImage();
  5. const Editor = createEditorComponent();
  6. const InputGroup = createInputGroup();
  7. const QuestionGroup = createQuestionGroup()
  8. new Vue({
  9. el: '#productEdit',
  10. components:{
  11. 'cm-radio': Radio,
  12. 'cm-select': Select,
  13. 'cm-option': Option,
  14. 'cm-upload-image': UploadImage,
  15. 'cm-editor': Editor,
  16. 'cm-input-group': InputGroup,
  17. 'cm-question-group': QuestionGroup
  18. },
  19. data:{
  20. status: 1,
  21. options: [
  22. {
  23. value: '选项1',
  24. label: '黄金糕',
  25. },
  26. {
  27. value: '选项2',
  28. label: '双皮奶',
  29. },
  30. {
  31. value: '选项3',
  32. label: '蚵仔煎',
  33. },
  34. {
  35. value: '选项4',
  36. label: '龙须面',
  37. },
  38. {
  39. value: '选项5',
  40. label: '北京烤鸭',
  41. },
  42. ],
  43. selected: '',
  44. youdian: '',
  45. paramsList: [
  46. {
  47. name: '品牌',
  48. value: '华硕'
  49. },
  50. {
  51. name: '尺寸',
  52. value: '30mm*30mm'
  53. }
  54. ],
  55. placeholderList: [{
  56. label: '例如:名牌',
  57. value: '请输入名牌信息'
  58. }],
  59. minLimit: 1
  60. },
  61. mounted: function(){
  62. $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
  63. $('.navLayout').find('.navList').eq(3).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
  64. },
  65. watch: {
  66. },
  67. methods: {
  68. handleRemove(item){
  69. console.log(item);
  70. },
  71. handleAdd(){
  72. console.log(1111);
  73. this.paramsList.push({
  74. name: '',
  75. value: ''
  76. })
  77. }
  78. }
  79. });