Skip to content

Commit

Permalink
fixed useSlots issue for [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Sep 23, 2024
1 parent c335011 commit 5fca34b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

* 2.8.4
- fixed useSlots issue for [email protected]

* 2.8.3
- fixed issue for loading TypeScript config file

Expand Down
21 changes: 17 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,26 @@ class MonocartReporter {
this.tickTime = this.options.tickTime || 1000;
this.tickStart();

// read trends from json before clean dir
getTrends(this.options.trend).then((trends) => {
// console.log('=========================== ', 'trends', trends.length);
this.trends = trends;
});

this.init();

}

async init() {

this.options.cwd = Util.formatPath(process.cwd());

// read trends from json before clean dir
this.trends = await getTrends(this.options.trend);

// init outputDir
const outputFile = await Util.resolveOutputFile(this.options.outputFile);
this.options.outputFile = outputFile;

const outputDir = path.dirname(outputFile);

Util.initDir(outputDir);
// for visitor relative path of attachments
this.options.outputDir = outputDir;

Expand All @@ -85,6 +88,14 @@ class MonocartReporter {
this.bindFunctions(stateOptions);
this.stateServer = createStateServer(stateOptions);
}

this.cleanOutputDir();

}

cleanOutputDir() {
Util.initDir(this.options.outputDir);
// console.log('=========================== ', 'cleanOutputDir');
}

// ==========================================================================
Expand Down Expand Up @@ -139,6 +150,8 @@ class MonocartReporter {
this.config = config;
this.root = suite;

// console.log('=========================== ', 'onBegin');

// output dir for test results (not reporter)
this.options.testOutputDir = config.projects[0].outputDir;
// console.log(`onBegin: ${suite.allTests().length} tests`);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/icon-label.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const props = defineProps({
});
const el = ref(null);
const slots = useSlots();
const classMap = computed(() => {
const list = ['mcr-icon-label', 'vui-flex-row'];
Expand All @@ -59,7 +60,6 @@ const styleMap = computed(() => {
});
const getSlot = function() {
const slots = useSlots();
const fun = slots.default;
if (typeof fun === 'function') {
return fun();
Expand Down
2 changes: 1 addition & 1 deletion packages/network/src/components/icon-label.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const props = defineProps({
});
const el = ref(null);
const slots = useSlots();
const classMap = computed(() => {
const list = ['mcr-icon-label', 'vui-flex-row'];
Expand All @@ -60,7 +61,6 @@ const styleMap = computed(() => {
});
const getSlot = function() {
const slots = useSlots();
const fun = slots.default;
if (typeof fun === 'function') {
return fun();
Expand Down

0 comments on commit 5fca34b

Please sign in to comment.