mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(docs): add vscode docs support (#19309)
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
"tslib": "^1.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@stencil/core": "1.3.2",
|
||||
"@stencil/core": "1.4.0",
|
||||
"@stencil/sass": "1.0.1",
|
||||
"@types/jest": "24.0.17",
|
||||
"@types/node": "12.7.1",
|
||||
|
||||
@@ -9,22 +9,22 @@ export const watchForOptions = <T extends HTMLElement>(containerEl: HTMLElement,
|
||||
return mutation;
|
||||
};
|
||||
|
||||
const getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string) => {
|
||||
let newOption: T | undefined;
|
||||
const getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string): T | undefined => {
|
||||
let newOption: HTMLElement | undefined;
|
||||
mutationList.forEach(mut => {
|
||||
// tslint:disable-next-line: prefer-for-of
|
||||
for (let i = 0; i < mut.addedNodes.length; i++) {
|
||||
newOption = findCheckedOption(mut.addedNodes[i], tagName) || newOption;
|
||||
}
|
||||
});
|
||||
return newOption;
|
||||
return newOption as any;
|
||||
};
|
||||
|
||||
export const findCheckedOption = (el: any, tagName: string) => {
|
||||
if (el.nodeType !== 1) {
|
||||
return undefined;
|
||||
}
|
||||
const options = (el.tagName === tagName.toUpperCase())
|
||||
const options: HTMLElement[] = (el.tagName === tagName.toUpperCase())
|
||||
? [el]
|
||||
: Array.from(el.querySelectorAll(tagName));
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ export const config: Config = {
|
||||
})
|
||||
],
|
||||
outputTargets: [
|
||||
{
|
||||
type: 'docs-vscode',
|
||||
file: 'dist/html.html-data.json',
|
||||
sourceCodeBaseUrl: 'https://github.com/ionic-team/ionic/tree/master/core/',
|
||||
},
|
||||
{
|
||||
type: 'dist',
|
||||
esmLoaderPath: '../loader',
|
||||
|
||||
Reference in New Issue
Block a user